a && b

From Bohemia Interactive Community
Jump to: navigation, search
Introduced with Operation Flashpoint version 1.00
  

Click on the images for descriptions

Introduced in

Game:
Operation Flashpoint
Version:
1.00

Description

Description:
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). Identical to: a and b

Syntax

Syntax:
a && b
Parameters:
a: Boolean - Test condition or variable that returns Boolean.
b: Boolean - Test condition or variable that returns Boolean.
Return Value:
Boolean

Alternative Syntax

Syntax:
a && {b}         (Available since ArmA 2:OA v1.62.)
Parameters:
a: Boolean - Test condition or variable that returns Boolean.
b: Boolean - Test condition or variable that returns Boolean. It is not evaluated if a returns as false.
Return Value:
Boolean

Examples

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

Additional Information

Multiplayer:
no special considerations
See also:
andorOperators

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

Notes

Bottom Section