Else

An IF Statement with an ELSE condition contains an alternative calculation. If the logical expression is false, control passes to the statement after the ELSE keyword.

Syntax

Else

There are no parameters for this keyword.

Example

Here is an example:

IF (@("FirstAmount") < 1000.00) THEN
   $FinalAmount = @("FirstAmount") * .05;
ELSE
   $FinalAmount = @("FirstAmount") + 10.00; 
END;
RETURN ($FinalAmount)

If the value of the section variable field FirstAmount is less than 1000.00 then the amount is multiplied by .05 and entered in the target variable $FinalAmount.

If, however, the value of the section variable field FirstAmount is greater than or equal to 1000.00 then 10.00 is added to the amount and entered in the target variable $FinalAmount.

The value of the $FinalAmount field is then returned to the caller or section variable field.

Use of the keyword connector THEN is optional.

See also