a : b: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "[[Category:Scripting Commands ArmA|" to "[[Category:Scripting Commands Armed Assault|")
m (Some wiki formatting)
 
(39 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma |Game Name=
|sortKey= #


|1.00|Game Version=
|game1= arma1
____________________________________________________________________________________________
|version1= 1.00


| See [[switch do]] |DESCRIPTION=
|game2= arma2
____________________________________________________________________________________________
|version2= 1.00


| a [[a : b|:]] b |SYNTAX=
|game3= arma2oa
|version3= 1.50


|p1= a: [[Switch Type]] |Parameter1=
|game4= tkoh
|version4= 1.00


|p2= b: [[Code]] |Parameter2=
|game5= arma3
|version5= 0.50


| [[Nothing]] |RETURNVALUE=
|gr1= Program Flow
____________________________________________________________________________________________


|x1= <code>? (_var [[a == b|==]] _test) [[a : b|:]] [[hint]] "_var is equal to _test!";</code> |EXAMPLE1=
|descr= See [[switch]]


|x2= <code>[[switch]] (_condition) [[do]] {
|s1= a [[a : b|:]] b
[[case]] 1[[a : b|:]] { [[hint]] "1" };
[[case]] 2[[a : b|:]] { [[hint]] "2" };
[[default]] { [[hint]] "default" }; {{cc|note: NO colon for the '''default''' case}}
};</code> |EXAMPLE2=


| [[Control Structures]], [[switch do]] |SEEALSO=
|p1= a: [[Switch Type]]
}}
 
|p2= b: [[Code]]


<h3 style="display:none">Notes</h3>
|r1= [[Nothing]]
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|x1= <sqs>? (_var == _test) : hint "_var is equal to _test!";</sqs>
</dl>


<h3 style="display:none">Bottom Section</h3>
|x2= <sqf>
switch (_condition) do
{
case 1: { hint "1" };
case 2: { hint "2" };
default { hint "default" }; // note: NO colon for the default case
};
</sqf>


[[Category:Scripting Commands|#]]
|seealso= [[Control Structures]] [[switch]]
[[Category:Scripting Commands Armed Assault|#]]
}}
[[Category:Scripting Commands Arma 2|#]]
[[Category:Scripting Commands Arma 3|#]]

Latest revision as of 14:38, 29 July 2022

Hover & click on the images for description

Description

Description:
See switch
Groups:
Program Flow

Syntax

Syntax:
a : b
Parameters:
a: Switch Type
b: Code
Return Value:
Nothing

Examples

Example 1:
? (_var == _test) : hint "_var is equal to _test!";
Example 2:
switch (_condition) do { case 1: { hint "1" }; case 2: { hint "2" }; default { hint "default" }; // note: NO colon for the default case };

Additional Information

See also:
Control Structures switch

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