INTOUCH® 4GL
A Guide to the INTOUCH Language


Previous Contents Index

SKIP(str_expr1 [, str_expr2] [, int_expr])

SKIP returns the position of the character following the last skipped character.

str_expr1 is the text string to be searched.

str_expr2 contains the list of characters which are to be skipped. If only one argument is given, SKIP will skip over spaces, tabs and nulls.

int_expr contains the search start position. This parameter is optional.


        10  a$ = '31415 hello' 
            z = SKIP(a$, '1234567890 ') 
        20  PRINT mid(a$, z) 
        30  END 
 
        RNH 
        Hello 

SORT$(str_expr1 [,str_expr2])

Sorts the elements from a str_expr1 in ASCII value order. Returns a list of the sorted elements.

str_expr1 contains the list of elements to be sorted.

str_expr2 is an optional separator. Default is a comma.


        10  a$ = 'code area is' 
            a_sort$ = SORT$(a$, ' ') 
            PRINT a_sort$ 
        20  END 
 
        RNH 
        area code is 

SPACE$(num_expr)

Returns the number of spaces indicated by num_expr.

SQR(num_expr)

SQR returns the square root of a number.

STR$(num_expr)

STR$ changes a number to a numeric string. The string that is created does not have any extra leading or trailing spaces.

?8pc

SYSTEXT$

or

SYSTEXT$(int_expr)

SYSTEXT$ returns the text associated with the operating system status specified. If no int_expr is supplied, INTOUCH returns the text for the last system status.

TAB(int_expr)

When used with the PRINT statement, the TAB function moves the cursor or print mechanism to the right to a specified column.

TAN(num_expr)

TAN returns the tangent of an angle that is specified in radians.

TANH(num_expr)

Returns the hyperbolic tangent of the numeric expression given.

TIME(int_expr)

The value returned by the TIME function depends on the value of int_expr.

If int_expr = 0, TIME returns the number of seconds since midnight.

If int_expr = 1, TIME returns the CPU time of the process in tenths of a second.

If int_expr = 2, TIME returns connect time of the current process in minutes.

?8pc

TIME$

or

TIME$(num_expr)

If num_expr is NOT specified, TIME$ returns the current time of day in HH:MM:SS format.

num_expr is the number of seconds since midnight. The result is returned in HH:MM format.


        10  PRINT TIME$(1800) 
            PRINT TIME$(54178) 
        20 END 
 
        RNH 
        00:30 
        15:02 

TIME(5)

Returns the number of seconds since INTOUCH was invoked. This function can be used to time events to the nearest 100th/sec.

TRIM$(str_expr)

Returns the string specified stripped of any leading or trailing spaces and tabs.


        10  LET a$ = '    HELLO    ' 
        20  PRINT '*'; a$; '*' 
        30  LET stripped$ = TRIM$(a$) 
        40  PRINT '*'; stripped$; '*' 
 
        RNH 
        *    HELLO    * 
        *HELLO* 

TRUE

Returns the constant 1. It is returned as an integer.

TRUNCATE(num_expr, int_expr)

Truncates a real number to a given number of decimal places.

UBOUND(array_name [, int_expr])

Given an array and a dimension number, returns the upper bound for that dimension. It returns an integer value. The default dimension is 1.

UCASE$(str_expr)

UCASE returns a string expression with all letters in upper case.

UNQUOTE$(str_expr)

The UNQUOTE$ function removes one set of quotes from a quoted string expression. If the string expression is not quoted, UNQUOTE$ leaves the string alone. UNQUOTE$ does not affect internally quoted elements.


        10  DO 
              CLEAR 
              PRINT AT 1,1: 
              MESSAGE 'Enter a line of text to be unquoted' 
              PRINT 'Text:' 
              INPUT '', LENGTH 50: line$ 
              IF  _BACK  OR  _EXIT  THEN  EXIT DO 
              IF  line$ = ''  THEN  REPEAT DO 
        20    PRINT 
              PRINT 'Quotes removed using the UNQUOTE$ function...' 
              PRINT UNQUOTE$(line$) 
              DELAY 
            LOOP 
        100 END 
 
        RNH 
        Text: 
        ? "I will not take these 'things' for granted" 
 
        Quotes removed using the UNQUOTE$ function... 
        I will not take these 'things' for granted 

VAL(num_str)

VAL returns the floating-point value of a numeric string.

VALID(text_str, rule_str)

VALID is used to validate user responses.

text_str is the text to be validated.

rule_str is the list of validation rules.

Multiple validation rules are separated by a semi-colon. If given characters are NOT between quotes, they are upper-cased.

VALID returns an error if there is an invalid validation rule.


        'Illegal validation rule' (-4021) 

VALID returns TRUE or FALSE according to the following validation rules:

WRAP$(str_expr, int_expr1, int_expr2)

Returns a word-wrapped text string, given left and right margins. Each line of the string is separated with a CR/LF.

Where string_expr = text string to wrap, int_expr1 = left margin, int_expr2 = right margin.

XLATE$(str_expr1, str_expr2)

The XLATE$ function translates one string to another by referencing a table you supply. For example, the XLATE$ function can translate from EBCDIC to ASCII. The first str_expr is the string to be translated. The second str_expr is the translation table.


Appendix B
Reserved Words

Reserved words are words that cannot be used as identifiers. INTOUCH's reserved words are:

The following words will be reserved in future versions:


Appendix C
INTOUCH's Error and Exception Messages

Errors are returned either immediately after typing a syntactically incorrect line, or when the RUN command is given and your program is syntactically incorrect.

C.1 Compile Errors


Previous Next Contents Index