IF/SELECT
IF Statements
IF statements are the primary conditional instructions. When reached, they evaluate whether a condition is true.
If the condition is found to be true, it can execute either a Jump or Call.
If it is not true, the instruction will occur as if the line were blank.
IF | Variable | Relational Operator | Variable | Action | Destination |
---|---|---|---|---|---|
IF | R[1] | = | 1 | Call | Program1 |
IF | DI[3] | = | ON | JMP | LBL[2] |
Additionally, when selecting the action field, another condition can be added with the AND or OR selection.
IF | Variable | Relational Operator | Variable | Modifier | Variable | Math | Variable | Action | Destination |
---|---|---|---|---|---|---|---|---|---|
IF | R[1] | = | 1 | AND | R[2] | > | AI[10] | JMP | LBL[2] |
Relational Operators
When selecting an IF statement, the first choice to be made is the relational operator within the equation to be evaluated.
Symbol | Name | Evalues To "True" When |
---|---|---|
= | Equal To | The left variable is equal to the right variable. |
<> | Not Equals | The left variable is not equal to the right variable. |
< | Less Than | The left variable is less than the right variable. |
<= | Less Than or Equal To | The left variable is less than or equal to the right variable. |
> | Greater Than | The left variable is greater than the right variable. |
>= | Greater Than or Equal To | The left variable is greater than or equal to the right variable. |
(...) | Mixed Logic |
Actions
In the event the equation evaluates as true, an action will occur. The following table lists the possible actions an IF statement can take.
Action | Destination | Description |
---|---|---|
JMP | LBL[#] | The program will jump to the labeled line and continue from there. |
CALL | Program | A program is CALLED. When the called program reaches the [END] instruction, it will return to the next line after the IF statement. |
Call | Program() |
SELECT Statements
When wanting to make a large list of possible conditions for a single variable, you'll likely want to use the SELECT option.
SELECT | Variable | Math | Variable | Action | Destination |
---|---|---|---|---|---|
SELECT | R[1] | = | 1 | Call | Program1 |
= | 2 | Call | Program2 | ||
= | 1 | Call | Program3 | ||
Else | JMP | LBL2 |