示例:
DATA:
TEXT1(30) VALUE 'This is the first text',
TEXT2(30) VALUE 'This is the second text',
TEXT3(30) VALUE 'This is the third text',
STRING(5) VALUE 'eco'.
IF TEXT1 CS STRING.
WRITE / 'Condition 1 is fulfilled'.
ELSEIF TEXT2 CS STRING.
WRITE / 'Condition 2 is fulfilled'.
ELSEIF TEXT3 CS STRING.
WRITE / 'Condition 3 is fulfilled'.
ELSE. WRITE / 'No condition is fulfilled'.ENDIF.
产生如下输 出:
Condition 2 is fulfilled.
这里,第二个逻辑表达式 TEXT2 CS STRING 是真,因为 字符串“eco” 存在于 TEXT2 中。
使用CASE分支 语法: CASE < f >. WHEN < F1 >. < statement block > WHEN