7.4

Table Of Contents
Example 2
if(&current.line > 50)
show('Bottom of page)
endif()
If (function)
Evaluates an expression and returns one of two specified values according to the results of the evaluation.
Syntax
if( expression, trueresult, falseresult ) any type
Arguments
expression
Boolean value. If it evaluates to true, the function returns the contents of trueresult, otherwise it returns the contents of falsere-
sult.
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 sec-
ond block, if one has been defined using the elseif statement. Otherwise, control flows to the first statement following the endif
command.
With PlanetPress Suite version 7.0, the elseif statement has been optimized to evaluate an argument, exactly like an if state-
ment, and elseif statements from other programming languages. In order to complete the if...elseif...endif command struc-
ture, however, an else statement was also added, acting exactly like the previous, empty elseif. Note that the use of the else
©2010 Objectif Lune Inc - 292 -