Xerox 05W String Operators, 12-16, Arithmetic Modifiers += -= *= /= %=, Copying Strings = + +=

Models: 07W & -11W 05W

1 370
Download 370 pages 7.04 Kb
Page 220
Image 220

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.

12-16

Page 220
Image 220
Xerox 05W, 07W & -11W manual String Operators, 12-16, Arithmetic Modifiers += -= *= /= %=, Copying Strings = + +=