6.0

Table Of Contents
105
Arguments
expression — Boolean value. If it evaluates to true, the function returns the contents of trueresult,
otherwise it returns the contents of falseresult.
trueresult, falseresult — Values of any type, as long as both are of the same type. The return value of the
function is therefore of the same type as trueresult and falseresult.
Code Sample Example
This example changes the text to display according to the current value of a variable.
Example
show(if(&pagenumber=1,'Customer Copy','Store Copy'))
If … ElseIf… EndIf (procedure)
This command structure can define up to two conditional blocks. Statements nested within the first block
are executed only if the condition specified in the if statement returns true. If it returns false, the program
branches to the first statement in the second block, if one has been defined using the elseif statement.
Otherwise, control flows to the first statement following the endif command.
Syntax
if( condition )
elseif()
endif()
Argument
condition — Value of type Boolean to evaluate.
Code Sample Example
This example simply prints 5 lines of text, selecting fonts according to line numbers.
Example
define(&x,integer,1)
%Define loop variable and then set up loop
for(&x,1,1,5)
if((&x mod 2)=0)