Programming 273
String
commands
A string is a sequence of characters enclosed in double
quotes (""). To put a double quote in a string, use two
consecutive double quotes. The \ character starts an
"escape" sequence, and the character(s) immediately
following are interpreted specially. \n inserts a new line,
two backslashes insert a single backslash.
Example: PRINT("Hello\nWorld!") displays
Hello
World!
on the terminal.
+ Syntax: str1 + str2 or str1 + expression
Adds two strings together.
Example 1: "QUICK"+"DRAW" returns "QUICKDRAW"
Example 2: 32
X;"X = "+X returns "X = 32"
asc Syntax: asc(str)
Returns a vector containing the ASCII codes of string str.
Example: asc("AB") returns [65,66]
char Syntax: char(vector or int)
Returns the string corresponding to the character codes in
vector, or the single code int.
Examples: char(65) returns "A"; char([82,77,72])
returns "RMH"
dim Syntax: dim(str)
Returns the number of characters in string str.
Example: dim("12345") is 5, dim("""") and dim("\n")
are both 1 (notice the use of the two double quotes and
the escape sequence).
expr Syntax: expr(str)
Parses the string str into a number or expression.
Examples: expr("2+3") returns 5. If the variable X has
the value 90, then expr("X+10") returns 100. In a