while

From Bohemia Interactive Community

Jump to: navigation, search
Editors, please check Policy: Scripting Command Page Syntax.
Introduced in Operation Flashpoint: Resistance version 1.85

Click on the images for descriptions

Introduced in

Game:
Operation Flashpoint: Resistance
Version:
1.85

Description

Description:
Repeat Code while condition is true.

Syntax

Syntax:
while {condition} do {Code}
Parameters:
condition : Boolean Code
Code
Return Value:
Nothing

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 {(not canStand _x) and (alive _x)} do {
    _x setDammage (getDammage _x) - 0.01;
  };
} forEach units group unitname;

Additional Information

Multiplayer:
Behaviour unknown.
See also:
Control Structures

Notes

Notes

+ Add Note

Only post proven facts here. Use the talk page or the forums for discussions.

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.
e.g. while {_a=_a+1; _a<10} do {...}


Bottom Section

Personal tools
Buy ArmA now!