Previous Next Chapter

Removes trailing blanks from the string argument. For example:

TRIM()

TRIM(string)

SAY length (TRIM(` abc `)) -> 4

Returns the integer part of the number argument followed by the specified number of decimal places. The default number of decimal places is 0. The number is padded with zeroes as necessary. For example:

TRUNC()

TRUNC(number[,places])

SAY TRUNC(123.456) -> 123
SAY TRUNC(123.456,4) -> 123.4560

UPPER()

UPPER(string)

Translate the string to uppercase. The action of this function is equivalent to that of TRANSLATE(string), but it is slightly faster for short strings. For example:

SAY UPPER(`One Fine Day') -> ONE FINE DAY

Returns the value of the symbol represented by the name argument. For example:

VALUE()

VALUE(name)

/*Assume that J has the value 12*/
SAY VALUE(`j') -> 12

VERIFY()

VERIFY(string,list[,'MATCH'])

Returns the index of the first character in the string argument which is not contained in the list argument or 0 if all of the characters are in the list. If the MATCH keyword is supplied, the function returns the index of the first character which is in the list or 0 if none of the characters are in the list. For example:

SAY VERIFY(`123456', `0123456789') -> 0
SAY VERIFY(`123a56', `0123456789') -> 4
SAY VERIFY(`123a45', `abcdefghij', `m') -> 4

Returns the nth word in the string argument or the null string if there are fewer than n words. For example:

WORD()

WORD(string,n)

SAY WORD(`Now is the time `,2) -> is

Returns the starting position of the nth word in the argument string or 0 if there are fewer than n words. For example:

WORDINDEX()

WORDINDEX(string,n)

SAY WORDINDEX(`Now is the time `,3) -> 8

Returns the length of the nth word in the string argument. For example:

WORDLENGTH()

WORDLENGTH(string,n)

SAY WORDLENGTH(`one two three',3) -> 5

Returns the number of words in the string argument. For example:

WORDS()

WORDS(string)

SAY WORDS("You don't SAY!") -> 3

Writes the string argument to the given logical file. The returned value is the actual number of characters written. For example:

WRITECH()

WRITECH(file,string)

SAY WRITECH(`output', `Testing') -> 7

WRITELN()

WRITELN(file,string)

Writes the string argument to the given logical file with a newline appended. The returned value is the actual number of characters written. For example:

SAY WRITELN(`output', `Testing') -> 8

Converts a string of hex digits into the (packed) character representation. Blank characters are permitted in the argument string at byte boundaries. For example:

X2C()

X2C(string)

SAY X2C(`12ab') -> `12ab'x
SAY X2C('12 ab') -> `12ab'x
SAY X2C(61) -> a

X2D()

X2D(hex,digits)

Converts a hexadecimal number to decimal. For example:

SAY X2D(`1f') -> 31

XRANGE()

XRANGE([start][,end])

Generates a string consisting of all characters numerically between the specified start and end values. The default start character is `00'x, and the default end character is `FF'x. Only the first character of the start and end arguments is significant. For example:

SAY XRANGE() -> `00010203 . . . FDFEFF'x
SAY XRANGE(`a', `f') -> `abcdef'
SAY XRANGE(,'0A'x) -> `000102030405060708090A'x

Top Previous Next Chapter