String operators – Xerox -05W User Manual

Page 220

Advertising
background image

12-16

Creating A Script File

Arithmetic Modifiers (+= -= *= /= %=)

These operators all act as per their usual function (if the = was ignored), but have the
effect that they substitute the resultant value back into the variable upon which they
were operating. For example:

var %Int = 9
Int += 1
wrt "Int = ", Int, "_n_r"
exit

would print the line:

Int = 10

String Operators

There are a limited number of operators that will successfully manipulate strings.
These are as follows:

+ += = == != < <= > >=

Copying Strings (= + +=)

These operators will copy one string either onto the end of another, or copy one
string to another.

For example:

var $String = "Hello"
var $Result
Result = String + " Everybody"

would set Result to contain the string "Hello Everybody"

Or alternatively:

var $String = "Hello"
String += " Everybody"

would change String to contain the string "Hello Everybody"

String Comparison (== != < <= > >=)

These operators enable strings to be compared.

The == operator will check that two strings are the same, whereas the != operator will
check that they are not the same.

Advertising
This manual is related to the following products: