IFNUM Conditional branch upon numeric variable comparison |
Top Previous Next |
This command is used to compare two variables, strings that contain numeric values (e.g., contain only digits 0 - 9), or numeric constants. The command results in a syntax error if either value is non-numeric.
For example, the following conditional branch is taken if the numeric variable x is equal to 1000.
SETNUM x = 1000 IFNUM= x 1000 goto equal value
The following conditional branch is taken if the numeric variable x is larger than 1000. (Numeric strings are used instead of numeric constants simply as an example of allowed syntax.)
SETNUM x = "2300" IFNUM> x "1000" goto larger value
Syntactically, no space is permitted to the left of the ‘!’, '=', '<' or '>' symbols, and a space is required to the right of these symbols.
Related Command(s): DEC, INC, SETNUM See also: Performing Variable Arithmetic and Numeric Comparisons
|