Chapter 4 Macro Function
|
ScrEdit Software User Manual
Revision Apr. 30th, 2007, 2007PDD23000002
4-29
Example:
IFB 1@M0 == ON THEN GOTO LABEL 1
IF…THEN CALL …
Equation: IF
V1
==
V2
THEN CALL
macro
If V1 is equal to V2, it will call macro. V1 and V2 should be internal memory or constant.
Example
If $2 is equal to 10, then it will call sub-macro 1.
IF $2 = 10 THEN CALL 1
IF…ELSE…ENDIF
Equation:
IF
expression1
Statement1
ELSEIF
expression2
Statement2
ELSE
Statement3
ENDIF
This is logical determination from multiple conditions. If
expression1
is true,
Statement1
will be
executed. If
expression1
is false, it will run
expression2
. If
expression2
is true,
Stemenent2
will be
executed. If both
expression1
and
expression2
are false,
Statement3
will be executed.
For the command of
expression
, please refer to table 4.3.5 (Comparison command table).
Example
If $1 is equal to 10, $1 = $1 + 1 is executed. If $1 is equal to 20, $1 = $1 + 2 is executed. If $1 is equal
to other value, $1 = $1 + 15 is executed.
IF $1 == 10
$1 = $1 + 1
ELSEIF $1 == 20
$1 = $1 + 2
ELSE
$1 = $1 + 15
ENDIF
ENDIF
ENDIF should be placed in the end of the IF comparison command. Please refer to the example of
Summary of Contents for AE80THTD
Page 1: ......