while

From Bohemia Interactive Community
Jump to: navigation, search
Introduced with Operation Flashpoint: Resistance version 1.85
  

Click on the images for descriptions

Introduced in

Game:
Operation Flashpoint: Resistance
Version:
1.85

Description

Description:
Repeats Code while condition is true. A part of while do construct.

Syntax

Syntax:
while condition
Parameters:
condition: Code
Return Value:
While Type

Examples

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

Multiplayer:
-
See also:
Control StructureswaitUntilfor dofor forspec

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

Notes

Posted on May 14, 2008
Kronzky
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 {...}

Bottom Section

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.