武装突袭 Wiki
Advertisement
  

点击图片可看到更多讯息

开始使用于

游戏:
Armed Assault
版本:
1.00

描述

描述:
End of for command, starts cycle.

基本句法

句法:
forCommand do code
参数:
forCommand: For Type
code: Code
返回值:
Anything

范例

范例1:
for "_x" from 20 to 10 step -2 do {..code..}

额外资讯

多人游戏:
-
也可以看看:
Control Structuresfor forspecwhile

注意事项

此处撰写句法皆为可行用法. 可到官网[1]专页回报错误. 你可以使用讨论页面或是论坛来进行讨论.
新增注意事项 | 如何新增?

Notes

Posted on June 4, 2015 - 19:45 (UTC)
Nickorr
Dont use this notation if you plan to change the cycle ranges dynamically. The range values are checked only before the cycle started. Use for_forspec instead.
Example, that won't work correctly: _xy = [1,2,3,4,5,6,7,8,9,10]; for "_i" from 0 to (count _xy - 1) do { if ( _xy select _i == 3 ) then { _xy deleteAt _i; _i = _i - 1; }; }; (Here the _i = 9 step will still be checked by the cycle, which will lead to "out of the array range" error.)
This code will work correctly: _xy = [1,2,3,4,5,6,7,8,9,10]; for [{_i=1},{_i<=(count xy - 1)},{_i=_i+1}] do { if ( _xy select _i == 3 ) then { _xy deleteAt _i; _i = _i - 1; }; }; (The last step here will be _i = 8 with array looking like this: [1,2,4,5,6,7,8,9,10])
Advertisement