7.4

Table Of Contents
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'))
IntToFloat (function)
Converts an integer expression into a measure value.
Syntax
inttofloat( expression ) measure value
Argument
expression
Integer value to be converted.
Code Sample Example
This example uses a loop to draw a series of blue rectangles.
Example
define(&x,integer,1)
%Define loop variable
setfillcolor([100,100,0,0])
%Fill blue
for(&x,1,1,10)
%Set up loop
%We must convert &x because rectfill
%expects measure values
rectfill(inttofloat(&x)/2,1,0.1,1)
%Draw rectangle
©2010 Objectif Lune Inc - 534 -