User Tools

Site Tools


4rpl:commands:switch

This is an old revision of the document!


Index
Flow Control

:!: Available in version 2.4.4 and later.

Switch

switch

Description

Allow for multiple selection control in a single, more compact form that multiple if/else if/endif endif format. This is intended to improve clarity by reducing otherwise repetitive coding.

Examples

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

See Also

4rpl/commands/switch.1661970495.txt.gz · Last modified: 2025/02/14 14:56 (external edit)