Difference between revisions of "while"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<dt class="note">([^<>]+) " to "<dt class="note">$1</dt> ")
m (Text replacement - " " to " ")
Line 34: Line 34:
<!-- Note Section END -->
<!-- Note Section END -->
Line 44: Line 43:
{{GameCategory|tkoh|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}

Revision as of 00:34, 1 February 2021

Hover & click on the images for description


Description needed
Program Flow


Syntax needed
condition: Code
Return Value:
Return value needed


Example 1:
while {a < b} do {a = a + 1};
Example 2:
A practical example: 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:
See also needed


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
Posted on May 14, 2008
The boolean code that's used to evaluate the while condition can be preceded by code that executes a regular command.
while {_a =_a + 1; _a < 10} do {...}

Posted on August 30, 2014 - 08:12 (UTC)
Killzone Kid
In non-scheduled environment, while do loop is limited to 10,000 iterations, after which it exits even if condition is still true. In scheduled environment no such limit exists.