点击图片可看到更多讯息
开始使用于
- 游戏:
- 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."}
额外资讯
注意事项
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.