PS TEXT FORMAT Reference Manual
Expressions
5-20 11387 Tandem Computers Incorporated
CHR Function The CHR function returns a character.
CHR (
exp
)
If
exp
is a string, CHR (
s-exp
) returns the first characters of that string. If
exp
is a number, CHR(
n
) returns the character that is the
n
th position in
the ASCII collating sequence. In this case,
n
must be within the range of 0
through 255. With this function, you can obtain characters you can’t type in
from the keyboard (and the printer can’t print).
The ORD function is the complement of the CHR function; see the
description of the ORD function. (S)
DEFINE Function The DEFINE function returns a “true” Boolean value (1) if it finds a
variable in the symbol table with the name specified by
var
, and that
variable represents a value.
DEFINE (
var
)
If the variable is undefined (a variable becomes “defined” when a value is
assigned to it), DEFINE returns a false value (0). (B)
FIND Function The FIND function searches the string specified by the first argument,
starting at the character position specified by
i-exp
, and tries to find the
substring specified by the second argument.
FIND ( s
-exp1
,
s-exp2
[ ,
i-exp
] )
If the FIND function finds the substring, it returns the position number of
the first character after the end of the substring.
For example, FIND(“string”,“in””) returns the number 6, the character
position of the “g” that follows “in.” If it can’t find the substring, FIND
returns zero.