a : b: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
m (Some wiki formatting)
 
(46 intermediate revisions by 3 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 ''':''' b |SYNTAX=
|game3= arma2oa
|version3= 1.50


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


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


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


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


|x2= <code>[[switch]] (_condition) [[do]] {
|s1= a [[a : b|:]] b
    [[case]] 1''':''' { [[hint]] "1" };
    [[case]] 2''':''' { [[hint]] "2" };
    [[default]] { [[hint]] "default" };
};</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>


 
|seealso= [[Control Structures]] [[switch]]
[[Category:Scripting Commands|#]]
}}
[[Category:Scripting Commands ArmA|#]]
[[Category:Scripting Commands ArmA2|#]]
[[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