a : b: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|=GROUP1" to "|GROUP1=")
m (Some wiki formatting)
 
(37 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


|gr1= Math |GROUP1=
|game2= arma2
____________________________________________________________________________________________
|version2= 1.00


| See [[switch do]] |DESCRIPTION=
|game3= arma2oa
____________________________________________________________________________________________
|version3= 1.50


| a [[a : b|:]] b |SYNTAX=
|game4= tkoh
|version4= 1.00


|p1= a: [[Switch Type]] |Parameter1=
|game5= arma3
|version5= 0.50


|p2= b: [[Code]] |Parameter2=
|gr1= Program Flow


| [[Nothing]] |RETURNVALUE=
|descr= See [[switch]]
____________________________________________________________________________________________


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


|x2= <code>[[switch]] (_condition) [[do]] {
|p1= a: [[Switch Type]]
[[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=
|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