13. Program Support Functions
13.4 Variable Commands
298
(3) Variable
quotations
Variables can be used for all addresses accept L(O), N and / (slash).
(a) When the variable value is used directly:
X#1.................................
Value
of #1 is used as the X value.
(b) When the complement of the variable value is used:
X
−
#2............................... Value with the #2 sign changed is used as the X value.
(c) When defining variables:
#3 = #5 ........................... Variable #3 uses the equivalent value of variable #5.
#1 = 1000 ....................... Variable #1 uses the equivalent value 1000 (which is treated as
1000.).
(d) When defining the variable arithmetic formula:
#1 = #3 + #2
−
100......... The value of the operation result of #3 + #2
−
100. is used as the
#1 value.
X [#1 + #3 + 1000] ......... The value of the operation result of #1 + #3 + 1000 is used as the
X value.
(Note 1)
A variable cannot be defined in the same block as an address. It must be defined in a
separate block.
Incorrect Correct
X#1 = #3 + 100;
→
#1 = #3 + 100;
X#1;
(Note 2)
Up to five sets of square parentheses [ ] may be used.
#543 =
−
[[[[[#120]/2+15.]
∗
3
−
#100]/#520 + #125 + #128]
∗
#130 + #132]
(Note 3)
There are no restrictions on the number of characters and number of variables for
variable definition.
(Note 4)
The variable values should be within a range form 0 to
±
99999999.
If this range is exceeded, the arithmetic operations may not be conducted properly.
(Note 5)
The variable definitions are valid from the moment that the variables are actually
defined.
#1 = 100 ;.............................. #1 = 100 (Valid from the next command)
#1 = 200 #2 = #1 + 200 ; ..... #1 = 200, #2 = 400 (Valid from the next command)
#3 = #1 + 300 ;...................... #3 = 500 (Valid from the next command)
(Note 6)
Variable quotations are always regarded as having a decimal point at the end.
When #100 = 10, then X#100 ; is treated as X10.