7.6

Table Of Contents
Code Sample Example
define(&mcolor,string,'')
&mcolor := 'White'
selectmedia(8.5,11,'Danny',&mcolor,20,0,0)
The code above will generate the following PostScript code (notice how the variable was
not replaced by its value).
612 792 0 ^SM (Danny) &mcolor 20 ^SPM
Program Control
Exit (procedure)
Exits from a for...endfor or repeat...until loop.
Syntax
exit()
Argument
None
Code Sample Example
This example shows how to break from a loop when a specific word, in this case ’Invoice,’ is found somewhere on the data
page.
define(&x,integer,1)
for(&x,1,1,&current.lpp)
if(pos('Invoice',@(&x,1,80))>0)
exit()
endif
endfor()
For EndFor (procedure)
This command structure allows a series of nested commands to be repeated a specified number of times. Each for statement
must have a corresponding endfor statement in order for PlanetPress Talk to know which commands to include in the loop.
Note that you cannot increment the counter for a for() loop, inside the loop.
If you open a document created a with a version of PlanetPress earlier than 5.2.0, and if that document includes a for() loop
with an increment greater than 1, you will notice that the loop is executed one less time than with your older version software
©2010 Objectif Lune Inc - 624 -