6.0

Table Of Contents
22
PlanetPress Talk Basics
1
description of the Messages area). You can also use these error reports to determine and fix problems in
your code.
Tips and Tricks
The following are useful to remember as you write your PlanetPress Talk scripts:
Defining program logic As for any coding, when you write programs in PlanetPress Talk you should work
through the logic of the program you intend to create before you start coding. This ensures the program
accomplishes what you intend it to accomplish, and makes the coding more straightforward. It can also
result in insights into different ways of accomplishing the same task, or raise issues that were not
immediately apparent.
Te st If you are writing a complicated script, it is recommended you use the PlanetPress Talk Editor, and
test your code regularly as you develop it. This helps you discover and solve any problems early on in the
development process.
Simplicity As in any programming language, aim for both simplicity and clarity in your scripts.
Using mathematical operators Enclose mathematical operators in parentheses ( ) to make your code easier
to read and therefore easier to maintain.
Performing complex calculations PlanetPress Talk limits its precision to 1/1000 to optimize speed and thus
is not designed to handle complex mathematical computations. If you require greater precision you
should perform the calculation outside PlanetPress Talk and include the result in the input data for your
document.
Case PlanetPress Talk is case-insensitive. It is good programming practice to establish case conventions
as it enhances the readability of the resulting code. It is recommended that you use lower case for all
PlanetPress Talk reserved words (names of system variables, operators, and commands) as this is the
default case convention of the PlanetPress Talk Editor.
Indent Use indents to visually represent the structure of the script. For example, indent the commands a
loop structure encloses to make it apparent where the loop begins and ends.
Comments Include meaningful comments in your code to make it easier to read and maintain.