6.0

Table Of Contents
Detailed Directions
21
Remember that arguments can be variables. The following returns the string of data found on line &line,
from column &col1 to column &col2 of the current data page:
@(&line, &col1, &col2)
You usually assign the result of a function to a variable or use it as an argument to another command. For
example:
&customer_name := @(&line, &col1, &col2)
You can also use the Data Selector to insert a PlanetPress Talk data selection command. This is often
quicker and more convenient than manually typing the data selection command. Consult the PlanetPress
Design User Guide, and in particular the area of the PlanetPress Design user interface you are using to enter
PlanetPress Talk code, for help.
Use Functions as Arguments
You can nest functions so that the value returned by one function becomes the argument for another
function. For example, in the following example, the string returned by the @ function becomes one of two
arguments for the strip function:
strip('*',@(36,25,58))
As a more complex example, consider the following:
if((pos('BLACK', strip( ' ', @(36,25,58))) > 0 ), 'old', 'new')
It returns the string ‘old’ if the data selection contains the string ‘BLACK’ and ‘new’ if it does not. When the
PlanetPress Talk interpreter evaluates the statement, it first selects the data on line 36 of the current data
page, from columns 25 through 58. It then sends that data to the strip command which removes all spaces
in the data. It then sends the data (which now contains no spaces) to the pos command, which determines
whether it contains the string ‘BLACK’. Finally, it compares the value returned by the pos command to 0,
and returns the value of that comparison to the if command.
Debug Scripts
The PlanetPress Talk Editor has a solid set of features for debugging PlanetPress Talk scripts, including
execution control, breakpoints, spies, expression evaluation, and changing the value of a variable during
execution. Consult the PlanetPress Design Talk Editor section of the PlanetPress Design User Guide for a
description of these features, and suggestions on other debugging techniques.
PlanetPress Talk includes a breakpoint command that you can enter anywhere you can enter a PlanetPress
Talk script. See “Breakpoint (procedure)” on page 74.
PlanetPress Design reports errors in PlanetPress Talk code in two places: the status bar of a dialog box
when you are entering a PlanetPress Talk expression in a text box within that dialog box, and the Messages
area of the PlanetPress Design Program Window (consult the PlanetPress Design User Guide for a