Using IF … THEN … ELSE Statements
From InterBase
Go Up to The Procedure Body
The IF … THEN … ELSE
statement selects alternative courses of action by testing a specified condition. The syntax of IF … THEN … ELSE
is as follows:
IF (<condition>) THEN <compound_statement> [ELSE <compound_statement>] <compound_statement> = {<block> | statement;}
The condition clause is an expression that must evaluate to TRUE
to execute the statement or block following THEN
. The optional ELSE
clause specifies an alternative statement or block to be executed if condition is FALSE
.
The following lines of code illustrate the use of IF … THEN
, assuming the variables LINE2
, FIRST
, and LAST
have been previously declared:
. . . IF (FIRST IS NOT NULL) THEN LINE2 = FIRST || ' ' || LAST; ELSE LINE2 = LAST; . . .