7.6

Table Of Contents
There are a number of ways to use variables in documents. See the PlanetPress User Guide for examples of some of the
most common uses people make of variables.
Local, Global, and System Variables
There are three categories of variables in PlanetPress Talk: system, global, and local.
1. System Variables
System variables are variables that the system defines. There are two types of system variables: system variables
with a global scope and system variables with a local scope.
System variables with a global scope System variables with a global scope are available anywhere you can
insert a PlanetPress Talk expression in PlanetPress. You can use the value of a system variable with a global scope but
you cannot, except in one or two cases, modify it.
System variables with a local scope System variables with a local scope are available only within a well-defined
context. There are currently two system variables with a local scope: &height and &width. Both are local to a spe-
cific object, group, or page. The system initializes &height and &width to, respectively, the values of the Height and
Width properties of the object, group, or page, as they appear in the Basic Attributes of that object, group, or page.
See "System Variables with Global Scope" (page 225) for a complete list of the system variables available in Plan-
etPress Talk.
2. Global Variables
Global variables are variables that you define using the Global Variable Properties dialog box in PlanetPress. Global var-
iables appear in TreeView in PlanetPress. Global variables have a global scope; you can reference global variables any-
where you can insert a PlanetPress Talk expression in PlanetPress.
You cannot define a global variable with the same name as a system variable.
3. Local Variables
Local variables are variables that you define using the PlanetPress Talkdefine command. Local variables have a local
scope; you can reference them only within the area of the object in which you create them. You can create local var-
iables within the PlanetPress Talk properties of an object or group, within the Text property of a text/box object, and
within the PlanetPress Talk Code property of a PlanetPress Talk object.
You should never define a local variable with the same name as a system variable.
System Variables with Local Scope
Name: Description:
&Height
System variable with a scope local to a specific object, group, or page. The system initializes this variable to the
value of the Height property of the objects, group’s, or page’s Basic Attributes. You can reference and set this var-
iable in any PlanetPress Talk code you enter in the object, group, or page.
&Width
System variable with a scope local to a specific object or group. The system initializes this variable to the value of
the Width property of the objects or group’s Basic Attributes. You can reference and set this variable in any Plan-
etPress Talk code you enter in the object, group, or page.
System Variables with Global Scope
Name: Description:
&EOJob
Read-only variable that returns True if the document has processed the last line of data or if the line that fol-
lows the last form feed character (ASCII 12) is empty.
&FirstSide
Read-only variable that returns True when a page is printing on the first side of a page in duplex mode (dou-
ble-sided printing). In simplex mode (single-sided) &firstside always returns True.
&PrinterMode
Returns the current output mode for the document. This allows you to test for a specific value and react
accordingly.
&Str Contains a line of input data.
©2010 Objectif Lune Inc - 225 -