switch: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{Command " to "{{RV|type=command ")
m (Text replacement - "\{\{( *)Important( *)\|" to "{{$1Feature$2|$2important$2|")
Line 9: Line 9:
| Creates a switch type that can be used inside a [[switch do|switch-do]] block.
| Creates a switch type that can be used inside a [[switch do|switch-do]] block.
<br><br>
<br><br>
{{Important | When it comes to strings, switch case matching is <b>case-sensitive</b>}}
{{Feature | important | When it comes to strings, switch case matching is <b>case-sensitive</b>}}


| [[switch]] condition
| [[switch]] condition

Revision as of 02:11, 7 February 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
Program Flow

Syntax

Syntax:
Syntax needed
Parameters:
condition: Anything
Return Value:
Return value needed

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:
See also needed

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