7.2

Table Of Contents
l "Use Functions as Arguments" (page 236)
l "Debug Scripts" (page 236)
l "Tips and Tricks" (page 236)
In this section, you find examples of how you can use PlanetPress Talk to do the following:
l "Print a variable number of copies of a page based on a value in the datastream" (page 237)
l "Store two lines of input data on one line of the data page" (page 238)
l "Print a page n-up" (page n)
l "Print a line of text on odd-numbered pages" (page 239)
l "Determine the proper page to print based on the width of the data in the data page" (page 239)
In this section you will be able to answer the following questions:
l "Assumed Knowledge" (page 215)
l PlanetPress Talk Basics
l "PlanetPress Talk Terminology" (page 217)
l "The Elements of PlanetPress Talk" (page 217)
l "PlanetPress Talk Syntax" (page 218)
l "Data Types" (page 220)
l "Variables" (page 222)
l "Runpage" (page 230)
l "Using Foreign Language Text with PPtalk" (page 230)
Learning PlanetPress Talk
One of the most efficient ways to familiarize yourself with PlanetPress Talk is to create an object, convert it to PlanetPress
Talk, and examine the code, consulting the PlanetPress Talk Language Reference as necessary for explanations of
each line of code. You can further verify your understanding by modifying the code and observing the changes that occur in
the object as a result.
As an example of this technique, the following is the code for a converted data selection object. The data selection is from col-
umns 1 through 12 on line 1 of the data page.
moveto(0,0)
setstyle(&Default)
margin(0,0.167)
rmoveto(stringwidth(''),0)
rmoveto(neg(stringwidth('')),0)
show(@(1,1,12))
Consider what each line of the code accomplishes, and notice that parameters to a function or procedure may themselves be
PlanetPress Talk expressions.
Command: Tells the document to:
moveto(0,0) Move the drawing pen to the top left of the object.
setstyle(&Default) Set the style for the data selection to the default style
margin(0,0.167) Set the offset for the text, relative to the top left of the object.
rmoveto(stringwidth('
'),0)
Move the pen forward the width of the data selection. Here, the purpose of this line is to set a
bounding box that appears around the data selection object in the document design window.
The bounding box does not print but is a visual cue that keeps the object visible even when its
contents are empty.
rmoveto(neg(stringwidth('
Move the pen backward the width of the data selection. This resets the pen to its position prior
to executing the previous command. It ensures the previous command does not alter the posi-
©2010 Objectif Lune Inc - 216 -