Documentation for Module: comparisons.r ||  Module Index

syntax: !overview Function for comparing, validating, debugging,
error handling.
author: Tim Johnson tim@akwebsoft.com

Global Index
=b dbg int-string? mrks safe-reduce
=n err-handler invalid-argument mysql-legal setd
=s err-report is-decimal no-data? setq
??? error-string is-email? not-found? shortest
abort export is-integer not-whitespace simple-error
aligned? fetch is-whitespace one? toss
all-lowercase form-error len-eq pass uppercase?
all-uppercase global? longest pos? wholenumber
between has-data? many? print-error within
data? int-block mrk raise  

Global function documentation

Function: =bTopGlobals IndexNext
    syntax: =b <str-val> Return empty block if unset value found
Function: =nTopGlobals IndexBackNext
    syntax: =n <str-val> Return none if unset value found
Function: =sTopGlobals IndexBackNext
    syntax: =s <str-val> Return empty string if unset value found
Function: ???TopGlobals IndexBackNext
    syntax: ??? <any-type> Prints information about words and values. Handles multiple docstrings.
Function: abortTopGlobals IndexBackNext
    syntax: abort <block-str-msg> Abort process and shut down
Function: aligned?TopGlobals IndexBackNext
    syntax: aligned? <series-or-int> <divisor>
    description: test to see if an integer or the length of a series
    is evenly divisible by a whole number.
Function: all-lowercaseTopGlobals IndexBackNext
    syntax: all-lowercase <string> Return true if string is all lower case
Function: all-uppercaseTopGlobals IndexBackNext
    syntax: all-uppercase <string> Return true if string is all upper case
Function: betweenTopGlobals IndexBackNext
    syntax: between <low-number> <val-number> <high-number>
    Description: Is val between low and high?
Function: data?TopGlobals IndexBackNext
    syntax: data? v Tests data in a series value. Returns false for empty series.
Function: dbgTopGlobals IndexBackNext
    syntax: dbg <any-type> Debugs a word, includes spelling. If an object,
    checks for a _data_ member and displays it.
    example:: a: 4 || dbg a => "a: 4"
Function: err-handlerTopGlobals IndexBackNext
    syntax: err-handler <error> Machine - sensitive error handler
Function: err-reportTopGlobals IndexBackNext
    syntax: err-report <err> simple error formating interface
Function: error-stringTopGlobals IndexBackNext
    syntax: error-string <error-object> Compose a string representation of error object.
    note: If you do not fully understand the magic of setting arg2 and arg3
      it would be useful to probe system/error. The 3 arguments are used
      to extract a human-readable message from the system/error object
Function: exportTopGlobals IndexBackNext
    syntax: export <block-of-words> Export local words in the global context.
    refinement: /to Export to this object instead of SYSTEM/WORDS
Function: fetchTopGlobals IndexBackNext
    syntax: fetch <any-type>
    Description: safe data retrieval. Handles any value.
    Refinements: with /seed, argument is the default value
    /deep - if block, reduce
    /same - if unset, return arg
    /default <any-default-value> - If evaluates to false return default value.
Function: form-errorTopGlobals IndexBackNext
    syntax: form-error <error-object> <markup-block>
    description: Compose a message representation of an error object.
    args: markup Use to make more readable. markup 1 & 4 wrap the message.
      markup 2 & 3 for near and where attributes respectively.
    Note: All four elements of markup are optional
    Note: Send email of error
    refinement: /user add footnote
Function: global?TopGlobals IndexBackNext
    syntax: global? <word> Is word global?
Function: has-data?TopGlobals IndexBackNext
    syntax: has-data? <any-type>
    return: False if empty series, string with only whitespace, none or false
Function: int-blockTopGlobals IndexBackNext
    syntax: int-block <block> Return true if all members are integers
Function: int-string?TopGlobals IndexBackNext
    syntax: int-string? <str-str>
    Return: Integer representation of string, or false
Function: invalid-argumentTopGlobals IndexBackNext
    syntax: invalid-argument <arg> Throw an "Invalid argument" error.
Function: is-decimalTopGlobals IndexBackNext
    syntax: is-decimal <str-str> <int-degrees-of-precision>
    description: Test if string is decimal and correct decimal places.
Function: is-email?TopGlobals IndexBackNext
    syntax: is-email? <string> Is string a legitimate email address?
Function: is-integerTopGlobals IndexBackNext
    syntax: is-integer <str-str>
    description: Test if value can be converted to an integer
Function: is-whitespaceTopGlobals IndexBackNext
    syntax: is-whitespace <char>
Function: len-eqTopGlobals IndexBackNext
    syntax: len-eq <str-where> <s1-series> <s2-series>
    Description: Raise an exception if S1 and S2 are not equal in length.
Function: longestTopGlobals IndexBackNext
    syntax: longest <block> Returns length of longest member of a series
    Note:: Non-series members are ignored
Function: many?TopGlobals IndexBackNext
    syntax: many? <number> True if number is greater than 1
Function: mrkTopGlobals IndexBackNext
    syntax: mrk refinement <str-msg> Simple but effective debugging for CGI.
Function: mrksTopGlobals IndexBackNext
    syntax: mrks <str-s> Simple but effective debugging for CGI.
Function: mysql-legalTopGlobals IndexBackNext
    syntax: mysql-legal <str-str>
    description: Convert a string to a legal mysql identifier.
    refinement: (upper) Words are capitalized, else join words with underscores
    refinement: (nodefault) Don't return the default value
Function: no-data?TopGlobals IndexBackNext
    syntax: no-data? v Returns true of v has no data.
Function: not-found?TopGlobals IndexBackNext
    syntax: not-found? <val> Is val equal to the not-found constant?
Function: not-whitespaceTopGlobals IndexBackNext
    syntax: not-whitespace <char>
Function: one?TopGlobals IndexBackNext
    syntax: one? <number> True if number is equal to 1
Function: passTopGlobals IndexBackNext
    syntax: pass Do nothing. Handy for readability.
Function: pos?TopGlobals IndexBackNext
    syntax: pos? <series-target> <any-type-v>
    description: Return index of location if found or none
Function: print-errorTopGlobals IndexBackNext
    syntax: print-error <obj-error>
    Description: Print out a disarmed and formatted error message.
    Example:
    except: either WorkStation[[print-error/simple disarm err ]][[err-handler err]]
    if error? set/any (quote err) try application except
(remember to quote err)
    Refinement: /at location extra information
    Refinement: /only Treat as if console application
    Refinement: /simple Don't format for HTML
Function: raiseTopGlobals IndexBackNext
    syntax: raise <str-block-message> User-raised error
    Refinement: (/at) Location, or anything extra
Function: safe-reduceTopGlobals IndexBackNext
    syntax: safe-reduce <block> Reduce block, leaving unset values
    refinement: /deep - Reduce nested blocks
Function: setdTopGlobals IndexBackNext
    syntax: setd <any-d> <any-default>
    Description: check for unset values and return default if found.
Function: setqTopGlobals IndexBackNext
    syntax: setq <word> <any-type>
    description: Reset an existing word with a value to a new value.
    Best used with globals inside of a def block. No tick is needed.
Function: shortestTopGlobals IndexBackNext
    syntax: shortest <block> Returns shortest length of members of a block.
Function: simple-errorTopGlobals IndexBackNext
    syntax: simple-error <str-blk-msg> Provide error message and quit
    refinement: /continue Don't quit /with <color-block> - custom fg and bg colors
    refinement: /finish - shut down specific resources
Function: tossTopGlobals IndexBackNext
    syntax: toss <str-block-msg> Compose and throw a user error.
Function: uppercase?TopGlobals IndexBackNext
    syntax: uppercase? <string> Is string all upper case?
Function: wholenumberTopGlobals IndexBackNext
    syntax: wholenumber <str-or-int-val> Does val translate to a whole number
Function: withinTopGlobals IndexBack
    syntax: within <low-number> <val-number> <high-number>
    Description: Is val equal to or greater than low and and less than or
     equal to high?

Global function documentation