Switch: Difference between revisions
Jump to navigation
Jump to search
Hendricks266 (talk | contribs) No edit summary |
Doom64hunter (talk | contribs) Remove misleading information |
||
(One intermediate revision by one other user not shown) | |||
Line 13: | Line 13: | ||
endswitch | endswitch | ||
The '''case''' keyword works like an [[ifvare]] statement, and '''default''' operates on every possibility that is ''not'' specified by a case statement. | The '''case''' keyword works like an [[ifvare]] statement, and '''default''' operates on every possibility that is ''not'' specified by a case statement. Each case block must be terminated with a '''[[break]]''' statement. | ||
See: [http://www.cplusplus.com/doc/tutorial/control/ Control Structures @ C++ Documentation] | See: [http://www.cplusplus.com/doc/tutorial/control/ Control Structures @ C++ Documentation] | ||
[[Category:EDuke commands]] | [[Category:EDuke commands]] |
Latest revision as of 23:16, 11 September 2021
The switch statement in CON is similar to that in C.
switch <gamevar> case <constant> <do something> break case <constant> <do something> break default <do something> break endswitch
The case keyword works like an ifvare statement, and default operates on every possibility that is not specified by a case statement. Each case block must be terminated with a break statement.