MC-Basic:IF ... THEN ... ELSE
This decision construct enables one section of code or another to be executed, depending on the state of a specified condition. A condition is an expression that, when evaluated, is TRUE if the result is not zero, and FALSE if the result is zero. The ELSE section is optional, but must be followed by at least one statement. IF statements may be nested within each other. There is no ELSE IF command. If you you an IF after ELSE, you must place IF on a new line.
IF <condition> THEN
<first statement to execute if condition is true>
<multiple statements to execute if condition is true>
<first statement to execute if condition is false>
<multiple statements to execute if condition is false>}
Task , Config
Do not use IF…THEN…ELSE in Config.prg.
IF SYSTEM.din.1 = 0 Then ‘check input #1
Jog x_axis 100
Jog x_axis 200