switch: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
|||
Line 18: | Line 18: | ||
|x1= <code>switch (_a) [[do]] {[[case]] 1: {block}; [[case]] 2 : {block}; [[default]] {block};}</code> |= Example 1 | |x1= <code>switch (_a) [[do]] {[[case]] 1: {block}; [[case]] 2 : {block}; [[default]] {block};}</code> |= Example 1 | ||
|x2= <code>_color<nowiki>=</nowiki>switch (side player) do { <br> | |x2= <code>_color<nowiki>=</nowiki>switch (side player) do { <br> case west: {"ColorGreen"}; <br> case east: {"ColorRed"}; <br>};</code> | ||
| [[Control Structures]] |= See also | |||
}} | |||
<h3 style="display:none">Notes</h3> | |||
<dl class="command_description"> | |||
<!-- Note Section BEGIN --> | |||
<!-- Note Section END --> | |||
</dl> | |||
<h3 style="display:none">Bottom Section</h3> | |||
[[Category:Scripting Commands|SWITCH]] | |||
[[Category:Scripting Commands ArmA|SWITCH]] | |||
[[Category:ArmA: Control Structures|SWITCH]] | |||
[[Category:Command Group: Program Flow|SWITCH]] |
Revision as of 03:41, 12 April 2007
Description
- Description:
- See switch do
- Groups:
- Uncategorised
Syntax
- Syntax:
- switch exp
- Parameters:
- exp: Switch Type
- Return Value:
- Anything
Examples
- Example 1:
switch (_a) do {case 1: {block}; case 2 : {block}; default {block};}
- Example 2:
_color=switch (side player) do {
case west: {"ColorGreen"};
case east: {"ColorRed"};
};
Additional Information
- See also:
- Control Structures
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