ifCommand exitWith code

Operand types

ifCommand : If Type
code: Code

Type of returned value

Description

If result of condition is true, evaluates code, and current block with result of code.
exitWith exits the execution of a context, which doesnt mean it will exit a script.
A context is defined, for example, by while loops, for loops, if blocks, etc.
To simplify, if you have code between {}, then you have a context.

Used In

ArmA

Example

if (_x>5) exitWith {echo "_x is too big";_x}
Result is when _x is greater then 5, outputs message and terminates code in current level with value of _x
Search OFPEC COMREF