
5. SYMBOLIC MACRO PROGRAM
B–66102E/10
30
(8) Array variable coding
Variables can be used as a one-dimensional array by using a simple
coding method.
Coding method
#999<expression>
999: Number of first variable in array
By this coding method, variables can be referenced or written to as
array data with an index indicated by the expression and starting with
the variable specified in 999.
#100<#101> is equivalent to #[100+#101].
(9) Reference list page eject control ($EJECT control statement)
By using the $EJECT control statement, reference list page eject
operation can be freely controlled.
Example)
Program file
/:
$EJECT
/
: ⇐ Advances reference list page.
O0003 ;
D
D
(10)Enhancement of IF and WHILE statements
The IF and WHILE statements have been enhanced.
(a) Determination of an operation result
Only an operation expression can be specified as the condition of
the IF or WHILE statement. The execution of the IF or WHILE
statement is controlled depending on whether the operation result
is equal to 0.
Format:
WHILE[operation-expression] DOx ;
ENDx ;
IF[operation-expression] GOTO xxx ;
IF[operation-expression] THEN<Macro statement>;
Example)
The left macro instructions are equivalent to the right macro
instructions.
WHILE[#100]DO1; å WHILE[#100 NE 0]DO1;
DD
DD
END1; END1;
IF[#100+#101]GOTO123; å IF[[#100+#101]NE 0 ]GOTO123;
IF[SIN[#1]]THEN #1=0; å IF [SIN[#1] NE 0] THEN #1=0 ;
(b) Logical operations, AND and OR
Multiple conditions can be specified in an IF statement. The
conditions ANDed or ORed control the execution of the IF
statement.
Format :
IF[<condition>&&<condition>]GOTO xxx;
IF[<condition>||<condition>]THEN<MACRO statement> ;
An AND is represented with an && sign and OR with an ££ sign.
Up to three ANDs or ORs can be specified in a single IF
statement. However, an AND and OR must not be specified
together in a single IF statement.