do: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\[\[Category:Scripting Commands OFP 1.[4-9]{2}(\|(\{\{uc:\{\{PAGENAME\}\}\}\}|#))?\]\] " to "") |
m (formatting) |
||
Line 1: | Line 1: | ||
{{RV|type=command | {{RV|type=command | ||
| | |game1= ofp | ||
|version1= 1.85 | |||
|game2= ofpe | |||
|version2= 1.00 | |||
|game3= arma1 | |||
|version3= 1.00 | |||
|game4= arma2 | |||
|version4= 1.00 | |||
|game5= arma2oa | |||
|version5= 1.51 | |||
|game6= tkoh | |||
|version6= 1.00 | |||
|game7= arma3 | |||
|version7= 0.50 | |||
|gr1= Program Flow | |gr1= Program Flow | ||
| | |descr= Executes ''code''. Used as part of a construct, such as [[while]], [[with]], [[for]] and [[switch]]. The ''code'' is always executed in [[missionNamespace]] unless [[do]] is used with [[with]] as an argument. | ||
| construct [[do]] code | |s1= construct [[do]] code | ||
|p1= construct: | |p1= construct: [[While Type]] ([[while]]), [[With Type]] ([[with]]), [[For Type]] ([[for]]), [[Switch Type]] ([[switch]]) | ||
|p2= code: [[Code]] | |p2= code: [[Code]] | ||
| [[Anything]] | |r1= [[Anything]] | ||
|x1= <code>[[while]] { b > a } [[do]] { a = a + 1 };</code> | |x1= <code>[[while]] { b > a } [[do]] { a = a + 1 };</code> | ||
Line 32: | Line 52: | ||
|seealso= [[Control Structures]] | |seealso= [[Control Structures]] | ||
}} | }} | ||
Revision as of 01:48, 27 March 2021
Description
- Description:
- Executes code. Used as part of a construct, such as while, with, for and switch. The code is always executed in missionNamespace unless do is used with with as an argument.
- Groups:
- Program Flow
Syntax
- Syntax:
- construct do code
- Parameters:
- construct: While Type (while), With Type (with), For Type (for), Switch Type (switch)
- code: Code
- Return Value:
- Anything
Examples
- Example 1:
while { b > a } do { a = a + 1 };
- Example 2:
- Repair all members of a group to such a level that they are able to stand up:
{ while {!canStand _x && alive _x} do { _x setDamage (damage _x - 0.01); }; } forEach units group unitname;
Additional Information
- See also:
- Control Structures
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
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.85
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Program Flow