
B–66102E/10
5. SYMBOLIC MACRO PROGRAM
31
IF[<condition>&&<condition>&&<condition>&&
<condition>] THEN<MACRO stmnt>; –OK
IF[<condition>||<condition>||<condition>||
<condition>]GOTO xxx; –OK
IF[<condition>&&<condition>||<condition>]
GOTO xxx ; –NG
Example)
IF[#100 EQ 1 && #101 GT 0] GOTO 100 ;
IF[#100 E Q1 ||#101 NE 1 || #102 GT 10 ] THEN #102=1 ;
(c) IF/THEN/ELSE/ENDIF
The syntax of an IF statement has been enhanced. Structured
programming is possible using IF/THEN/ELSE/ENDIF.
The following shows the formats of syntactically valid IF
statements.
IF[...]GOTO 999 ;
IF[...]THEN Macro-st ;
IF[...]THEN Macro-st;
*
Macro-st:
ELSE Macro-st; Macro statement
IF[...]THEN ;
Statement ;
*
Statement:
D Macro or NC statement
D
ENDIF ;
IF[...]THEN ;
Statement ;
D
D
ELSE ;
Statement ;
D
D
ENDIF ;
a) When only a single macro statement is to be executed, the macro
statement can be specified immediately after THEN/ELSE as
shown in and .
IF[#100 EQ 0] THEN #101 = 1;
ELSE #101 = 2;
b) When an instruction to be executed is an NC statement or
multiple instructions to be executed, the NC statement or
multiple instructions must be specified between the
THEN/ELSE line and ENDIF line as shown in and .
IF[#100 EQ 0] THEN ;
GO1 X100 Y200 ;
ENDIF ;
When instructions with THEN and ELSE must be executed as
shown in , the IF statement can be specified by combining the
formats in a) and b).