User Tools

Site Tools


4rpl:commands:case

Index
Flow Control

:!: Available in version 2.4.4 and later.

Case

case

Description

defines one of the alternative selections in a switch statement that will be evaluated. The first selection that evaluates to true will be executed and evaluation of further alternatives will not be performed. If none of the alternatives evaluate to true, then execution will continue at the first statement following the endswitch statement.

Examples

switch
    case(<-currentState 0 ==) 
        @HandleIdle
    endcase
 
    case(<-currentState 1 ==) 
        @HandleMove
    endcase
 
    case(<-currentState 2 ==) 
        @HandleFire
    endcase
endswitch

See Also

4rpl/commands/case.txt · Last modified: 2022/08/31 14:34 by Karsten75