switch: Difference between revisions
Jump to navigation
Jump to search
(Created own page for switch as it is an operator for it's own (see https://foxhound.international/arma-3-sqf-grammar.html for reference)) |
m (category) |
||
Line 48: | Line 48: | ||
</dl> | </dl> | ||
[[Category:Scripting Commands| | [[Category:Scripting Commands|SWITCH]] | ||
[[Category:Scripting Commands ArmA| | [[Category:Scripting Commands ArmA|SWITCH]] | ||
[[Category:ArmA: Control Structures|{{uc:{{PAGENAME}}}}]] | [[Category:ArmA: Control Structures|{{uc:{{PAGENAME}}}}]] | ||
[[Category:Command Group: Program Flow|{{uc:{{PAGENAME}}}}]] | [[Category:Command Group: Program Flow|{{uc:{{PAGENAME}}}}]] |
Revision as of 12:31, 28 March 2017
Description
- Description:
- Creates a switch type that can be used inside a switch do -block
- Groups:
- Uncategorised
Syntax
- Syntax:
- switch arg
- Parameters:
- arg: Anything
- Return Value:
- Switch Type
Examples
- Example 1:
_mySwitch = switch "Test"; _mySwitch do {/*Something*/};
- Example 2:
switch (_a) do { case 1 : { /*...code...*/ }; case 2 : { /*...code...*/ }; default { /*...code...*/ }; };
switch (_condition) do { case 1: { hint "1" }; case 2: { hint "2" }; default { hint "default" }; };
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 Structuresswitch do, a:bcasedefault
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