beautypg.com

Delta Electronics DELTA DUP-B User Manual

Page 367

background image

Chapter 3 Creating and Editing Screens

IF…ELSEIF…ELSE…ENDIF

Equation
IF expression1
Statement1
ELSEIF expression2
Statement2
ELSE
Statement3
ENDIF

Explanation
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. ENDIF should be placed in the
end of the IF comparison command

Remark

Please refer to the Comparison command table on previous page 3-343 for the
command of expression.


Example

IF $0 == 0
$10 = 0
ELSEIF $0 ==1
$10 = 1
ELSE
$10 = 2
ENDIF

If $0 is equal to 0,
$10 is equal to 0;
If $0 is equal to 1, not equal to 0,
$10 is equal to 1;
If $0 is equal to neither 0 nor 1,,

$10 is equal to 2.










3-346

Revision May, 2010