while: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 1: Line 1:
[[Category:Scripting Commands|WHILE]]
{{Command|= Comments
[[Category:Scripting Commands OFP 1.96|WHILE]]
____________________________________________________________________________________________
[[Category:Scripting Commands ArmA|WHILE]]
[[Category:Armed Assault: Control Flows|WHILE]]


| ofpr |= Game name


<h2 style="color:#000066">'''while '' condition'''''</h2>
|1.85|= Game version
____________________________________________________________________________________________


| First part of while construct.
Examples: while {x<10} [[do]] {x=x+1} A more practical example: To repair all the members of a group to such a level that they are all able to stand up:
{while {[[not]] [[canStand]] _x} [[do]] {_x [[setDammage]] ([[getDammage]] _x) - 0.01}} [[forEach]] units [[group]] unitname |= Description
____________________________________________________________________________________________


'''Operand types:'''
| '''while''' condition |= Syntax


'''condition:''' [[String]]
|p1= condition: [[String]] |= Parameter 1


'''Type of returned value:'''
| [[While Type]] |= Return value
____________________________________________________________________________________________


[[While Type]]
|  |= See also


'''Compatibility:'''
}}


Added in version '''1.85'''
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->


'''Description:'''
<!-- Note Section END -->
</dl>


First part of while construct.
<h3 style="display:none">Bottom Section</h3>




'''Examples:'''
[[Category:Scripting Commands|WHILE]]
 
[[Category:Scripting Commands OFP 1.96|WHILE]]
'''while''' {x<10} [[do]] {x=x+1}
[[Category:Scripting Commands ArmA|WHILE]]
 
[[Category:Armed Assault: Control Flows|WHILE]]
A more practical example:
 
To repair all the members of a group to such a level that they are all able to stand up:<br>
{'''while''' {[[not]] [[canStand]] _x} [[do]] {_x [[setDammage]] ([[getDammage]] _x) - 0.01}} [[forEach]] units [[group]] ''unitname''

Revision as of 22:06, 1 August 2006

Hover & click on the images for description

Description

Description:
Description needed
Groups:
Uncategorised

Syntax

Syntax:
Syntax needed
Return Value:
Return value needed

Examples

Examples:
Example needed

Additional Information

See also:
See also needed

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

forEach units group unitname |= Description

____________________________________________________________________________________________

| while condition |= Syntax

|p1= condition: String |= Parameter 1

| While Type |= Return value ____________________________________________________________________________________________

| |= See also

}}

Notes

Bottom Section