
11-20
Example
REM Executes a plural condition decision.
SELECT CASE Index
'The command is executed if the index value matches the CASE
'statement value.
CASE 0 'When the index is 0.
STOP 'Ends the program.
CASE 1 'When the index is 1.
HALT “STOP” 'Suspends the execution of the program.
CASE 2 'When the index is 2.
HOLD “STOP” 'Suspends the execution of the program.
CASE 3 'When the index is 3.
STOPEND
'Stops a continuous program or stops the program after a cycle.
CASE 4 'When the index is 4.
ON li1 + li2 GOSUB *samp1, *samp2, *samp3
'Calls the subroutine of the label name written at the same level as the
'value of li1 + li2.
CASE 5 'When the index is 5.
ON li1 + li2 GOTO *samp1, *samp2, *samp3
'Jumps to the label written at the same level as the value of li1 + li2.
CASE 6 TO 8 'When the index is 6 to 8.
PRINTDBG “ Reservation “ 'Outputs a message to the debug window.
CASE IS ≥ 9 'When the index is 9 or more.
END 'Declares the end of motion by the program.
END SELECT '
Declares the end of the plural conditional decision statement.
Komentarze do niniejszej Instrukcji