Arma 3 Scripting

and

  • Arma 3 v0.50
  • First in Operation Flashpoint v1.00
  • Alias of a && b

Command · also in Math · Markdown · JSON · original wiki page

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 ignored.

Syntax

Syntax 1

a and b

Parameters:

Returns: Boolean

Syntax 2

since arma2oa 1.62

a and b

Parameters:

Returns: Boolean

Examples

Example 1

if ((not isNull player) and (alive player) and (_enemycount == 0)) then
{
    hint "you win !";
};

Example 2

if ((count _array > 0) and { (_array select 0) == player }) then    // works as expected
{
    hint "It works!";
};

if ((count _array > 0) and (_array select 0) == player) then        // Error: _array select 0 is evaluated
{
    hint "It... works?";
};

See also

a && b · or · Operators