SELECT CASE variable
Condition - The condition which will cause the associated code commands to be executed or not.
Code - Command statements which will be executed dependant upon the evaluation of the condition.
Terminates a select case command. The command can either be specified as a single word, 'endselect' or as two separate words, 'end select'.
- Applies To:
- See Also:
- Related Create:
Switch outputs depending on the value of a variable
Switch outputs 1 and 2 on or off depending on the value of variable b1
- Code Example:
select case b1
case 1 ; if b1 is 1, turn output 1 on
case 2,3 ; if b1 is 2 or 3, turn output 1 off
case 4 to 6 ; if b1 is between 4 and 6 (inclusive), turn output 2 on
else ; if none of these are true, turn output 2 off
Submit an Example
Submit Your Own Code!
You must be logged in to submit code examples. Login now.