武装突袭 Wiki
注册
Advertisement
Introduced with Operation Flashpoint version 1.00
  

点击图片可看到更多讯息

开始使用于

游戏:
Operation Flashpoint
版本:
1.00

描述

描述:
Returns true only if one or both conditions are true. In case of the alternative syntax, lazy evaluation is used (if left operand is true, evaluation of the right side is skipped completely). Identical to: a || b

基本句法

句法:
Boolean = a or b
参数:
a: Boolean - Test condition or variable that returns Boolean.
b: Boolean - Test condition or variable that returns Boolean.
返回值:
Boolean

替代句法

句法:
Boolean = a or b (Only available since ArmA 2:OA v1.62.)
参数:
a: Boolean - Test condition or variable that returns Boolean.
b: Code - Code that returns Boolean. It is not evaluated if a returns as true.
返回值:
Boolean

范例

范例1:
if ((OBJ1) or (_enemycount == 0)) then {hint "you win !"}
范例2:
if ((count _array == 0) or {(_array select 0) != player}) then {hint "It works! Without lazy evaluation it would throw an error if array was empty."}

额外资讯

多人游戏:
no special considerations
也可以看看:
a bandOperators

注意事项

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

Notes

Bottom Section

Posted on March 29, 2015 - 13:07 (UTC)
IT07
The examples suggest that you can only use two conditions with or. You can use more if you want. It is not recommended to use a lot of conditions because the check will take longer to complete.
Advertisement