点击图片可看到更多讯息
开始使用于
- 游戏:
- Operation Flashpoint
- 版本:
- 1.00
描述
- 描述:
- Returns true only if both conditions are true. In case of the alternative syntax, lazy evaluation is used (if left operand is false, evaluation of the right side is skipped completely).
基本句法
- 句法:
- Boolean = a and b
- 参数:
- a: Boolean - Test condition or variable that returns Boolean.
- b: Boolean - Test condition or variable that returns Boolean.
- 返回值:
- Boolean
替代句法
- 句法:
- Boolean = a and 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 false.
- 返回值:
- Boolean
范例
- 范例1:
if ((alive player) and (_enemycount == 0)) then {hint "you win !"}
- 范例2:
if ((count _array > 0) and {(_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 April 12, 2015 - 10:45 (UTC)
- IT07
-
Just like the "or" command, the "and" command allows several conditions to be checked. Example:
if(alive player and speed player > 0 and _someOtherVar) then { hint"All three condtions are true" };
The example above will check if the player is alive and if the player is moving and checks if _someOtherVar is true.