7.5

Table Of Contents
Select Data
You use the @ function to select data in PlanetPress Talk. This command selects data on a single line of the data page. For
example, the following returns the string of data found on line 3, from column 12 through 30 of the current data page:
@(3,12,30)
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 con-
venient than manually typing the data selection command. Consult the PlanetPress User Guide, and in particular the area
of the PlanetPress 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 Talk
Editor section of the PlanetPress User Guide for a description of these features, and suggestions on other debugging tech-
niques.
PlanetPress Talk includes a breakpoint command that you can enter anywhere you can enter a PlanetPress Talk script. See
"Breakpoint (procedure)" (page 561).
PlanetPress reports errors in PlanetPress Talk code in two places: the status bar of a dialog box when you are entering a Plan-
etPress Talk expression in a text box within that dialog box, and the Messages area of the PlanetPress Program Window (con-
sult the PlanetPress User Guide for a description of the Messages area). You can also use these error reports to
determine and fix problems in your code.
©2010 Objectif Lune Inc - 238 -