If

LRM §9.4.

If executes statements dependent on a condition.

Syntax:

if ( condition )
  statement
[ else if ( condition )
  statement ]
[ else
  statement ]

Description:

The if statement executes the statement if the condition evaluates to true. The condition is considered to be true if it is non-zero, and false if it is zero.

The statements must be enclosed in a begin-end or fork-join block if more than one statement is to be executed.

Example:

if (A)
  Q = 1;
else if (B == 6)
  Q = 2;
else
  Q = 0;

Notes:

See also:

Case