- Name:
-
endselect
- Syntax:
-
SELECT CASE variable
CASE condition
{code}
ELSE
{code}
ENDSELECT
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.
- Description:
-
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:
-
All
- See Also:
-
- Related Create:
-
- Share:
-
- Print:
-
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
high 1
case 2,3 ; if b1 is 2 or 3, turn output 1 off
low 1
case 4 to 6 ; if b1 is between 4 and 6 (inclusive), turn output 2 on
high 2
else ; if none of these are true, turn output 2 off
low 2
endselect
Copy Code
Submit an Example
Submit Your Own Code!
You must be logged in to submit code examples. Login now.