switch: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "| arma |" to "| arma1 |") |
Lou Montana (talk | contribs) m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Armed[ _]Assault(\|.*)]]" to "{{GameCategory|arma1|Scripting Commands}}") |
||
Line 54: | Line 54: | ||
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]] | ||
{{GameCategory|arma1|Scripting Commands}} | |||
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]] | ||
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]] |
Revision as of 06:09, 8 January 2021
Description
- Description:
- Creates a switch type that can be used inside a switch-do block.
- Groups:
- Program Flow
Syntax
- Syntax:
- switch condition
- Parameters:
- condition: Anything
- Return Value:
- Switch Type
Examples
- Example 1:
private _mySwitch = switch "Test"; _mySwitch do { /* Something */ };
- Example 2:
switch (_condition) do { case 1: { hint "1" }; case 2: { hint "2" }; default { hint "default" }; };
- Example 3:
switch (_condition) do { case "string1"; case "string2": { hint "string1 or string2" }; case "string3"; case "string4": { hint "string3 or string4" }; default { hint "default" }; };
Additional Information
- See also:
- Control Structures switch do a:b case default
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note