Xerox -07W & -11W Printer User Manual


 
12-14
Creating A Script File
Script Operators
The script language supports various arithmetic operators to facilitate calculations and
manipulations on numeric variables and discrete numeric values. Some of the
operators are also extended to provide some useful manipulations on strings and
string variables. Operators such as + and * are straight forward. Those that are not so
intuitive will be described with the aid of script examples.
The valid operators are as follows:
( ) * / % + - < <= > >= == != = += -= *= /= %=
Numeric Operators
Subtraction (-)
The - operator takes on one of two guises, depending on how it is used. It is
interpreted as a simple subtraction operator in a command such as:
Data = 4 - 2
which would set the value stored in Data to 2. However, it can also be used as a
negate or "unary minus" operator when used in the following way:
Data = 4 * -2
which would set the value stored in Data to -8.
Less Than, Greater Than (< <= > >=)
These provide a test allowing the comparison of two numeric values, of use within an
IF statement. For example:
var %Input
inp "Input a number, between 1 and 10", Input
if (Input <= 0)
goto routine1:
else if (Input > 10)
goto routine1:
else
{
wrt "Input value = ", Input, "_n_r"
goto routine2:
}
routine1:
wrt "You gave an invalid input_n_r"
routine2:
exit