while: Difference between revisions
Jump to navigation
Jump to search
m (added see also, revert) |
m (fixed formatting) |
||
Line 17: | Line 17: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= <code>while {x<10} [[do]] {x<nowiki>=</nowiki>x+1} </code>|= Example 1 | |||
|x2=A practical example: Repair all members of a group to such a level that they are able to stand up: <code><nowiki>{</nowiki><br> while <nowiki>{</nowiki>([[not]] [[canStand]] _x) [[and]] ([[alive]] _x)<nowiki>}</nowiki> [[do]] <nowiki>{</nowiki><br> _x [[setDammage]] ([[getDammage]] _x) - 0.01;<br> <nowiki>};</nowiki><br><nowiki>}</nowiki> [[forEach]] units [[group]] unitname; </code> |= Example 2____________________________________________________________ | |||
| [[Control Structures]] |= See also | | [[Control Structures]] |= See also | ||
Line 32: | Line 31: | ||
<!-- Note Section END --> | <!-- Note Section END --> | ||
</dl> | </dl> | ||
<h3 style="display:none">Bottom Section</h3> | <h3 style="display:none">Bottom Section</h3> |
Revision as of 06:30, 17 January 2007
Description
- Description:
- First part of while construct.
- Groups:
- Uncategorised
Syntax
- Syntax:
- while condition
- Parameters:
- condition: Code
- Return Value:
- While Type
Examples
- Example 1:
while {x<10} do {x=x+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
- 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
Notes
Bottom Section
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint: Resistance version 1.85
- Operation Flashpoint: Resistance: New Scripting Commands
- Operation Flashpoint: Resistance: Scripting Commands
- Command Group: Uncategorised
- Scripting Commands OFP 1.96
- Scripting Commands ArmA
- ArmA: Control Structures
- Command Group: Program Flow