This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
4rpl:commands:switch [2022/09/07 12:41] – added programming note and 2nd example Karsten75 | 4rpl:commands:switch [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 6: | Line 6: | ||
:!: Available in version 2.4.4 and later. | :!: Available in version 2.4.4 and later. | ||
- | ====== | + | ====== |
switch | switch | ||
===== Description ===== | ===== 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. | 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. | ||
+ | |||
+ | All code between '' | ||
=== Programming note === | === Programming note === | ||
Line 28: | Line 30: | ||
@HandleFire | @HandleFire | ||
endcase | endcase | ||
+ | @HandleException # no case statement evaluated to TRUE | ||
endswitch | endswitch | ||
</ | </ | ||
Line 41: | Line 44: | ||
Trace ("Case 2 is valid" | Trace ("Case 2 is valid" | ||
| | ||
+ | | ||
endSwitch | endSwitch | ||
- | Trace(" | ||
</ | </ | ||