while: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{Command|= Comments
#REDIRECT [[Control Structures#while-Loop]]
____________________________________________________________________________________________
 
| ofpr |= Game name
 
|1.85|= Game version
____________________________________________________________________________________________
 
| First part of while construct. |= Description
____________________________________________________________________________________________
 
| '''while ''condition''''' |= Syntax
 
|p1= condition: [[Code]] |= Parameter 1
 
| [[While Type]] |= Return value
____________________________________________________________________________________________
 
||x1= <code>while {x<10} [[do]] {x<nowiki>=</nowiki>x+1} </code>|= Example 1
 
||x2=A more practical example: To repair all the members of a group to such a level that they are all able to stand up: <code><nowiki>{</nowiki>while <nowiki>{</nowiki>([[not]] [[canStand]] _x) [[and]] [[alive]] _x)<nowiki>}</nowiki> [[do]] <nowiki>{</nowiki>_x [[setDammage]] ([[getDammage]] _x) - 0.01<nowiki>}}</nowiki>[[forEach]] units
[[group]] unitname </code> |= Example 2
____________________________________________________________________________________________
|  |= See also
 
}}
 
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
 
<!-- Note Section END -->
</dl>
 
<h3 style="display:none">Bottom Section</h3>
 


[[Category:Scripting Commands|WHILE]]
[[Category:Scripting Commands|WHILE]]

Revision as of 20:33, 21 December 2006