Programming 587
Conditional Tests
Conditional tests let programs make decisions. For example, depending on whether a
test is true or false, a program can decide which of two actions to perform. Conditional
tests are used with control structures such as
If...EndIf and loops such as
While...EndWhile (described later in this module).
mid Returns a specified number of characters from any position
within a string.
ord Returns the character code of the first character within a
string. This is the opposite of the char command.
right Returns a specified number of characters from the right side
(end) of a string.
rotate Rotates the characters in a string. The default is L1 (rotate
right one character).
shift Shifts the characters in a string and replaces them with
spaces. The default is L1 (shift right one character and
replace with one space). Examples: shift("abcde",2)
⇒"cde "
and shift("abcde")
⇒" abcd"
string Converts a numeric expression into a string. This is the
opposite of the expr command.
Command Description