if statement

Syntax

//if only

if (<boolean expression>) then

begin

<statements>;

end;

...or...

//if, else (note no ; after first end)

if (<expression>) then

begin

<statements>;

end

else

begin

<statements>;

end;

For example

lnNumber : number := 6;

 

if (lnNumber <> 6) then

begin

print("That's unexpected!");

end;

 

//...or...

 

if (lnNumber <> 6) then

begin

print("That's unexpected!");

end

else

begin

print("That's more like it!");

end;