switch: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(add. classification)
mNo edit summary
Line 18: Line 18:
   
   
|x1= <code>switch (_a) [[switch do|do]] {[[case]] 1: {block}; [[case]] 2 : {block}; [[default]] {block};}</code> |= Example 1
|x1= <code>switch (_a) [[switch do|do]] {[[case]] 1: {block}; [[case]] 2 : {block}; [[default]] {block};}</code> |= Example 1
|x2= <code>_color<nowiki>=</nowiki>switch (side player) do { <br>&nbsp;&nbsp;case west: {"ColorGreen"}; <br>&nbsp;&nbsp;case east: {"ColorRed"}; <br>};</code>
|x2= <code>_color <nowiki>=</nowiki><br>switch (side player) do <br>{ <br>&nbsp;&nbsp;case west: {"ColorGreen"}; <br>&nbsp;&nbsp;case east: {"ColorRed"}; <br>};</code>





Revision as of 14:36, 16 May 2010

-wrong parameter ("Arma") defined!-1.00
Hover & click on the images for description

Description

Description:
See switch do
Groups:
Uncategorised

Syntax

Syntax:
switch exp
Parameters:
exp: Anything
Return Value:
Switch Type

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

Notes

Bottom Section