END USER LICENSE AGREEMENT
AND LIMITED WARRANTY
IMPORTANT - READ CAREFULLY
1. LICENSE AGREEMENT AND LIMITED WARRANTY AGREEMENT. - This End User License Agreement (“EULA”) and Limited Warranty (hereinafter collectively the
“License Agreement”) constitute a legal agreement between you (either as a physical, legal person (e.g. corporation) or a partnership) and Objectif Lune Inc.
(“Objectif Lune”) for the software product identified as PlanetPress® Suite, including all companion products, components, patches, updates and upgrades, and also
including any computer software, PostScript® programs, media and all accompanying on-line or printed documentation (collectively the “Software”). The Software
also includes Adobe® Technology and related documentation, and any upgrades, modified versions, additions and copies thereof.
2. BINDING EFFECT. - BY INSTALLING, COPYING, OR OTHERWISE USING THE SOFTWARE, YOU, AS NON-EXCLUSIVE SUB LICENSEE, ACCEPT TO BE AND YOU ARE BOUND BY
ALL OF THE TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT. IF YOU ARE THE ORIGINAL PURCHASER OF THE SOFTWARE AND DO NOT AGREE WITH THE TERMS
AND CONDITIONS OF THE LICENSE AGREEMENT, PROMPTLY RETURN THE UNUSED SOFTWARE TO THE PLACE FROM WHICH YOU OBTAINED IT FOR A FULL REFUND. BY
YOUR ACCEPTANCE OF THE TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT AS MENTIONED ABOVE, OBJECTIF LUNE GRANTS YOU THE RIGHT TO USE THE SOFTWARE IN THE MANNER HEREIN PROVIDED.
3. COPYRIGHTS. - This Software is owned by Objectif Lune or its suppliers and is protected by the Copyright Act (Canada), any copyright law and international copyright treaties. Therefore, you must treat this Software like any other copyrighted material (e.g., a book), except that you may, for example, make one copy of the
Software solely a) for backup or archival purposes or b) if it is essential for the compatibility of the computer program, or transfer the Software to a single hard disk,
provided you keep the original solely for backup or archival purposes and that such copy is not installed or used on any other computer.
4. PROPERTY AND INTELLECTUAL PROPERTY RIGHTS. - All Objectif Lune’s libraries, source code, byte code executables and any other files (collectively the “files”)
remain Objectif Lune’s exclusive property. Regardless of any modifications that you make, you may not distribute any files (particularly but not limited to Objectif
Lune source code and other non-executable files) except those that Objectif Lune has expressly designated. Nothing in this License Agreement permits you to derive
the source code of files provided to you in executable form only, or to reproduce, modify, use or distribute the source code of such files. This License Agree ment does
not grant you any intellectual property rights in the Software.
5. TRANSFER. - You may transfer the Software only on a permanent basis, provided you retain no copies except as provided in Section 3 and the recipient or transferee shall be bound by the terms of this License Agreement. Except as provided in this License Agreement, you may not transfer, rent, lease, lend, copy, modify,
adapt, translate, sublicense or time-share in any manner the Software or any part hereof.
6. TRADE SECRET. - You acknowledge that the Software in source code, its structure and organization form remains a confidential valuable trade secret of Objectif
Lune or its suppliers and therefore you agree not to modify the Software or attempt to reverse engineer, decompile or disassemble or otherwise attempt to discover
the source code of the Software.
7. UPGRADED VERSION. - If you have purchased an upgrade version of the Software, this version constitutes a single product with and forms part of the Software.
Any transfer of an upgrade version of the Software can be made only in accordance with this License Agreement.
8. SCOPE OF USE. - You agree to use the Software for your own customary business or personal purposes on only one device (physical or virtual computer system). If
you need to use the Software on more than one device, you must purchase additional licenses. Contact Objectif Lune for applicable royalties payable and licensing
terms. Please refer to th e appropriate following sections 9 o r 10 “ADDITIONAL LICENS E TERMS” for “Variable Content Documents” or - for “Optimized PostScript and
Windows Printing outputs”.
9. ADDITIONAL LICENSE TERMS FOR VARIABLE CONTENT DOCUMENTS. - If the Software can or will generate or create or modify Postscript programs called “Variable
Content Documents” (VCD), any VCD generated by the Software is licensed on a per “licensed output device” basis (including, without limitation, printers, Adobe
Acrobat Distiller, Aladdin Ghostscript, etc.). This means that any VCD generated by the Software can be used by any number of users as long as they use the VCD on
only that single licensed output device. If you need to use the VCD on more than one output device, you must purchase additional licenses. In case of cluster printing
systems (multiple print engines attached to a single Raster Image Processor (RIP), each print engine needs to be licensed individually. Contact Objectif Lune for the
applicable royalties payable and licensing terms for distribution of any VCD.
10. ADDITIONAL LICENSE TE RMS FOR OPTIMIZED POSTSCRIPT AND WINDOWS PRI NTING OUTPUTS.- Section 9 does not apply for PlanetPress Server’s “Optimized Postscript” or “Windows Printing”.
11. TERM. - This license is effective until terminated. Objectif Lune has the right to terminate your license immediately if yo
of this Agreement. Upon ter mination, you must destroy the original and any copy of the Software and cease all use of all the trademarks mentioned herein.
12. LIMITED WARRANTY. - Objectif Lune warrants that the Software media will be free from defects in materials and workmanship, for a period of ninety (90) days
from the date of its purchase.
You must report all errors and return the Software to the location where you bought it with a copy of your receipt within such period to be eligible for warranty service.
u fail to comply with any one of the terms
Objectif Lune’s and its suppliers’ liability and the exclusive remedy shall be, at Objectif Lune’s so le option, either (a) return of the price paid, or (b) repair or replacement of the Software if it does not meet Objectif Lune’s Limited Warranty and if returned to Objectif Lune with a copy of your receipt. No warranty is given by Objectif Lune for and in the name of any of its suppliers.
DO NOT RETURN ANY PRODUCT UNTIL YOU HAVE CALLED THE OBJECTIF LUNE CUSTOMER CARE DEPARTMENT AND PREVIOUSLY OBTAINED A RETURN AUTHORIZATION
NUMBER.
This Limited Warranty is void if failure of the Software results from accident, abuse or misapplication. Any replacement of the Software media will be warranted for
the remainder of the original warranty period or thirty (30) days, whichever is longer. Outside Canada, neither these remedies nor any product support services
offered by Objectif Lune are available without proof of purchase from a duly authorized non-Canadian source.
OBJECTIF LUNE DOES NOT AND CANNOT WARRANT THE PERFORMANCE OR RESULTS YOU MAY OBTAIN BY USING THE SOFTWARE. THIS LICENSE AGREEMENT STATES THE
SOLE AND EXCLUSIVE REMEDIES FOR OBJECTIF LUNE’S BREACH OF WARRANTY, EXPRESS OR IMPLIED, AS TO MERCHANTABILITY, NON-INFRINGEMENT OF THIRD PARTY
RIGHTS, OR FITNESS FOR A PARTICULAR PURPOSE.
For further warranty information, you may contact your nearest Objectif Lune representative. Contact information can be found at www.objectiflune.com.
13. LIMITATION OF LIABILITY. - IN NO EVENT SHALL OBJECTIF LUNE OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS, LOSS OF PROFITS OR SAVINGS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE OR THE PROVISION OF OR THE FAILURE TO
PROVIDE SUPPORT SERVICES, EVEN IF OBJECTIF LUNE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN ANY CASE, OBJECTIF LUNE’S ENTIRE LIABILITY
UNDER ANY PROVISION OF THIS LICENSE AGREEMENT SHALL BE LIMITED TO THE GREATER OF: A) THE AMOUNT PAID FOR THE PURCHASE OF THE SOFTWARE OR B)
CAD $25.
14. WARNING ? HIGH RISK ACTIVITIES. - THE SOFTWARE IS NOT FAULT-TOLERANT AND IS NOT DESIGNED, MANUFACTURED OR INTENDED FOR USE OR RESALE AS ONLINE CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE PERFORMANCE, SUCH AS, WITHOUT LIMITATION, IN THE OPERATION OF NUCLEAR
FACILITIES, AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE SUPPORT MACHINES OR WEAPONS SYSTEMS, IN WHICH THE
FAILURE OF THE SOFTWARE COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE (“HIGH RISK ACTIVITIES”).
OBJECTIF LUNE AND ITS SUPPLIERS SPECIFICALLY DISCLAIM ANY EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
15. GENERAL PROVISIONS. - This License Agreement may only be modified in writing by a duly authorized officer of Objectif Lune. If any or part of any provision of
this License Agreement is, by final judgment, found void or unenforceable, the remainder shall remain valid and enforceable according to its terms. Even if any remedy provided is determined to have failed for its essential purpose, all limitations of liability and exclusions of damages herein set forth shall remain in full force and
effect.
16. GOVERNING LAW. This License Agreement is governed by the laws in force in the Province of Québec (Canada) and parties hereby elect domicile in judicial district
of Montréal, Québec, Canada. This Agreement is not governed by the United Nations Convention on Contracts for the International Sale of Goods (CISG), the application of which being expressly exclud ed.
17. U.S. GOVERNMENT RESTRICTED RIGHTS. - If a Licensed Application is acquired under the terms of a proposal or agreement with the United States Governm ent or
any contractor therefor, the Licensed Application is subject to the following restricted rights notice: “This Software is commercial computer software provided with
RESTRICTED RIGHTS. Use, duplication, or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical
Data and Computer Software clause at DFARS 252.227-7013, FAR 52.227-17 Alternate III (g)(3), or subparagraphs (c)(1) and (2) of the Commercial Computer Software -- Restricted Rights at 48 CFR 52.227-19, as applicable, and their successor provisions. Contractor/Manufacturer is Objectif Lune Inc., Montréal, Québec, Canada, H1V 2C8.
18. U.S. EXPORT RULES. - You agree that the Software will not be shipped, transferred or exported into any country or used in any manner prohibited by the United
States Export Administration Act or any other export laws, restrictions or regulations (collectively the “Export Laws”). In add
export controlled items under the Export Laws, you represent and warrant that you are not a citizen of or otherwise located within an embargoed nation (including,
without limitation, Iran, Iraq, Syria, Sudan, Libya, Cuba, North Korea and Serbia) and that you are not otherwise prohibited under the Export Laws from receiving the
Software. All rights to use the Software are granted on condition that such rights are forfeited if you fail to comply with the terms of this paragraph.
This section introduces the PlanetPress Talk scripting language, describes where and how you can enter
PlanetPress Talk code in PlanetPress Design, explains its syntax and each of its elements, and offers some
tips and tricks for writing PlanetPress Talk scripts.
In this section, you learn to:
• “Learn PlanetPress Talk” on page 18
• “Integrate PlanetPress Talk into Documents” on page 19
• “Define and Assign Values to Variables” on page 20
• “Select Data” on page 20
1
1
PlanetPress Talk Basics
• “Use Functions as Arguments” on page 21
• “Debug Scripts” on page 21
• “Tips and Tricks” on page 22
In this section, you find examples of how you can use PlanetPress Talk to do the following:
• “Print a variable number of copies of a page based on a value in the datastream” on page 23
• “Store two lines of input data on one line of the data page” on page 24
• “Print a page n-up” on page 25
• “Print a line of text on odd-numbered pages” on page 26
• “Determine the proper page to print based on the width of the data in the data page” on page 27
In this section you will be able to answer the following questions:
• “What background does the PlanetPress Talk Language Reference assume?” on page 2
• “What is PlanetPress Talk and where can I use it in the documents I create?” on page 3
• “What terms does the PlanetPress Talk Language Reference use?” on page 4
• “What are the elements of the PlanetPress Talk scripting language?” on page 5
• “What are the rules for creating PlanetPress Talk scripts?” on page 6
• “What data types are available in PlanetPress Talk?” on page 8
• “What are variables?” on page 13
• “What is a runpage?” on page 14
• “Can PlanetPress Talk let me use foreign language text in PlanetPress Design?” on page 14
Key Concepts
Assumed Knowledge
What background does the
The PlanetPress Talk Language Reference does not provide information on the art and science of computer
programming. It assumes readers already have a solid grasp of programming concepts and techniques.
2
PlanetPress Talk Language Reference
assume?
PlanetPress Talk
What is PlanetPress Talk and where can I use it in the documents I create?
PlanetPress Talk is a scripting language developed by Objectif Lune, and described in detail in the
PlanetPress Talk Language Reference.
You can use PlanetPress Talk expressions in many places in the documents you create in PlanetPress
Design. You can enter a PlanetPress Talk expression in any text box with a maroon label.
You can also include complete PlanetPress Talk programs in your document. This provides the power and
flexibility that make even the most complex documents possible in PlanetPress Design. You enter
PlanetPress Talk programs when you create a user-defined emulation, and when you edit the PlanetPress
Talk properties of an object, a page, a document, or a condition. When you edit the PlanetPress Talk
properties, you can enter PlanetPress Talk code directly, or through the PlanetPress Talk Editor.
Finally, you can also write your own PlanetPress Talk functions from PlanetPress Design, making it easy to
extend the language to suit the requirements of your particular document or documents. 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.
Note that PlanetPress Talk is case-insensitive.
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 columns 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.
3
1
PlanetPress Talk Basics
Command:Tells the document to:
setstyle(&Default)
margin(0,0.167)
rmoveto(stringwidth(' '),0)
rmove to(n eg(s trin gwid th(' ' )),0 )
show(@(1,1,12))
Set the style for the data selection to the default style
Set the offset for the text, relative to the top left of the object.
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.
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 position of the
data selection.
Display the text that appears from columns 1 through 12 on line 1
of the current data page.
At this point you might want to introduce other commands into the code, or modify some commands and
verify the changes produce the result you expect. Or perhaps you want to create a new data selection that
starts in the middle of the data page and extends over several lines to see how PlanetPress Talk handles
multi-line data selections.
PlanetPress Talk Terminology
What terms does the
The PlanetPress Talk Language Reference uses the following terms:
Term:Is:
commandA generic term that encompasses operators, functions, procedures, condition structures,
expressionA piece of PlanetPress Talk code that includes at least one command and is at most one line
statementA single line of PlanetPress Talk code. For example:
script or
program
4
PlanetPress Talk Language Reference
and loop structures.
in length. For example:
&area := (&width * &height)
define(&max, integer, strtoint(@(1,1,4)))
A sequence of one or more lines of PlanetPress Talk code, executed sequentially. For
example the following script draws a filled shape:
What are the elements of the PlanetPress Talk scripting language?
PlanetPress Talk includes all of the features one expects in a scripting language. It has a defined set of data
types (see “Data Types” on page 8) and the following categories of elements that you use to build scripts:
Category:Description:
VariablesA variable is a value that changes over time. See “Variables” on page 13.
System objectsAn object is a set of related system variables. For example the
contains the system variables that describe the current x and y coordinates of the drawing
pen on the physical page. You reference one of the system variables in an object by prefixing
the name of the system object to the name of the variable. For example
references the x coordinate system variable in the physical system object.
Operators and
Operator functions
ProceduresA procedure performs an action. For example the
FunctionsA function performs an action and returns a value. For example the
Loop structuresRepeat a sequence of one or more commands until a specified condition is met. See “Loop
Condition structuresControl when a sequence of one or more commands executes. See “ Condition Structures” on
CommentsProvide a means for embedding documentation in your code, or for commenting out lines
An operator is a symbol that performs a common operation. For example, the
operator that adds two numbers together or concatenates two strings. An operator function
is an operator that does not use a symbol to represent its operation. For example the
command is an operator function. Both operators and operator functions operate on one or
more operands. For example the
(the operands). See “Operators and Operator Functions” on page 44 for a complete list of all
operators and operator functions available in PlanetPress Talk.
add command operates on two measure or integer values
curveto procedure draws a Bezier curve,
the
rectangle procedure draws a rectangle, and the setfillcolor procedure sets the fill
color. Most procedures require arguments. For example, the
six arguments: the x and y coordinates of the upper left hand corner of the rectangle, the
width and height of the rectangle, and whether it is filled and/or stroked.
converts an integer to a string, and returns the value of the resulting string. A function thus
has a data type that corresponds to that of the value it returns. You assign the result of a
function to a variable or use it as an argument in another command. Most functions require
arguments. For example the
want to convert to a string; it returns a string a nd thus the
Structures” on page 48.
page 48.
of code during debugging. See “% (procedure)” on page 62.
inttostr command requires a single argument: the integer you
physical system object
&physical.x
+ is an
add
rectangle procedure requires
inttostr function
inttostr fu nct ion is of t yp e st ri ng.
5
1
PlanetPress Talk Basics
PlanetPress Talk Syntax
What are the rules for creating PlanetPress Talk scripts?
The rules, or syntax, of the PlanetPress Talk language describe how you combine its elements to create
scripts.
Command Syntax
A PlanetPress Talk command has the form:
command_name( arguments )
Arguments can be constants, variables, or functions (see “Use Functions as Arguments” on page 21).
A command can require no arguments, or one or more arguments. When a command requires more than
one argument, you separate arguments by commas. The following are all examples of valid PlanetPress
Talk commands:
fill()
moveto( 2.2, 4.5 )
mul(4.7,2.1)
rectangle(0,0,3,3,true,true)
curveto(1,1,1,3,0.5,2)
set(¤t.line,¤t.line + 1)
store(¤t.line,trimleft(&str))
strtoint( @( 12,30,35) )
Spaces are not significant in PlanetPress Talk except between the name of a command and its opening
parenthesis. An error occurs if you leave a space between the name of a command and its opening
parenthesis.
show('this syntax is correct')
show ('this syntax produces an error')
Comments
PlanetPress Talk allows the use of comments within the code, but adding a comment at the end of a
PlanetPress Talk command is not permitted.
Case
PlanetPress Talk is case insensitive. Thus the following commands are all equivalent:
showright(@(1,34,64))
ShowRight(@(1,34,64))
SHOWRIGHT(@(1,34,64))
6
It is important to understand that arguments to commands are case sensitive. For example, the following
command returns False:
eq('bovine','Bovine')
Unit of Measure
Unless otherwise specified, the unit of measure in PlanetPress Talk is inch. Thus, for example, the
following line of code moves the current point to the X coordinate 1.5 inches, and the Y coordinate 2.5
inches.
moveto(1.5,2.5)
Statement or Expression Evaluation
The PlanetPress Talk interpreter uses parentheses to determine the order in which to evaluate the
individual parts of an expression or statement. It evaluates an expression or statement from the innermost
to the outermost set of parentheses. For example, consider the statement:
The interpreter first evaluates the data selection function (@), then the strip function (strip), then the start
position function (pos), and finally the if function.
The rule that says that multiplications and divisions should be performed before additions and
substractions, known as operator precedence, is not supported in PlanetPress Talk, so you should use
parentheses to simulate operator precedence. For example, if you use the equation 2 + 3 x 4, PlanetPress
Talk will calculate a total of 20, but if you use the equation 2 + (3 x 4), PlanetPress Talk will calculate a total
of 14.
Apostrophes and Backslashes within Strings
If you want to use an apostrophe (‘) or a backslash (\) within a string, you must precede it by a backslash.
For example:
show( 'Don\'t miss this offer!' )
Names
The names of any variables, global functions, objects, or styles you create with PlanetPress Talk must meet
the following requirements:
7
1
PlanetPress Talk Basics
• Names must be unique (no two elements in a document can have the same name).
• Names cannot begin with a number, and can contain only the following ASCII characters: underscore,
upper and lower case letters of the alphabet, all digits 0 through 9. If you use an underscore in the name,
it should not appear as either the first or last character of the name as this may cause internal conflicts in
the software.
• Names can be a maximum of 50 characters in length.
• PlanetPress Talk variable and command names are reserved words; you cannot use any of these reserved
words as a name.
It is always recom mended that you c hoose a name that reflects the content or purpose of the element you
are creating. A meaningful name makes it easier to distinguish one element from another, and thus makes
a document easier to maintain.
Data Types
What data types are available in PlanetPress Talk?
PlanetPress Talk provides the following data types:
Data TypeExample
Integer3
Measure or Floating Point3,2300987
Currency5.25
StringMichel or $4,567.09
BooleanYes or No
Color Array (CMYK)[100, 100, 0, 0]
Array[Monday Tuesday Wednesday Thursday Friday]
(a seven-element array of type string)
[12 18 103 57]
(a four-element array of type integer)
[True True False False True False False]
(a seven-element array of type Boolean)
Directory[c:\images\house.jpg c:\images\apt.jpg]
(a directory that contains two pathnames)
PlanetPress Talk strictly enforces its data types. For example, the show command accepts a string as its
argument; an error occurs if you attempt to send it an integer as an argument. You can use any of the
8
conversion operators PlanetPress Talk provides to convert from one type to another. Thus the following
show command is correct:
show(inttostr(subreccount()))
See “Conversion Operator Functions” on page 46 for a complete list of the operators you can use to convert
from one type to another.
Integers
You use integers for counters and simple calculations. Integers have no decimal precision.
IntegerLimit
Smallest on screen-2147483648
Largest on screen+2147483647
Smallest PostScript-2147483648
Largest PostScript+2147483647
Measures
Measures are real numbers and are often called floating-point numbers. Measures have a precision of
approximately 8 decimal places, with exact precision implementation dependent. If your document
requires complex mathematical computations in which a greater decimal precision is critical, it is
recommended you perform those calculations outside PlanetPress Design and include the result in the
input data.
MeasureLimit
Smallest on screen1.5 * 10
Largest on screen3.4 * 10
Smallest PostScript10
Largest PostScript10
-45
38
-38
38
Currency
Currency is a specific type of measure intended for use with numbers that represent monetary values. The
currency type has a precision of 4 decimal places, and can take on a minimum value of
-99999999999999.9999 and a maximum value of +99999999999999.9999. The only operations you can
perform on a currency type are addition, subtraction, multiplication and division, and negation.
9
1
PlanetPress Talk Basics
Strings
A string is a sequence of one or more alphanumeric characters. You often use strings to display information
on a page. You must enclose strings in single quotes, for example 'mystring'.
StringLength, in characters
Maximum on screen2147483647
Maximum PostScript65535
Booleans
Booleans have a value of either True or False. Every condition you define in PlanetPress Design resolves to
a Boolean value.
Color Array
A color array defines the percentages of Cyan, Magenta, Yellow and Black (CMYK) that compose a specific
color. The array consists of four integers representing, respectively, the percentages of cyan, magenta,
yellow and black that compose the color. The integers are separated by commas and enclosed in square
brackets. For example the color array [100, 100, 0, 0] represents the pure blue that corresponds to the RGB
values (0, 0, 255). It defines pure blue as 100% cyan, 100% magenta, 0% yellow, and 0% black.
Color arrays are primarily used internally by the PlanetPress Talk interpreter. However there are a handful
of commands that expect a color array as an argument (setfillcolor for example).
10
Arrays
An array is a table of values of the same data type. You reference each element of the array (each cell of the
table) independently. Arrays can be of type Boolean, integer, measure, currency, or string. The type of the
array defines the type of values each of its elements can contain. Thus in a Boolean array, the value of each
element is either True or False, and in a string array each element is a string value.
Arrays in PlanetPress Talk are one-dimensional. If you are not familiar with arrays from other
programming or scripting languages, you can think of a one-dimensional array as a single row of a table.
You specify the number of elements you want the array to contain, and initialize each of the elements,
when you define the array. Note that you cannot subsequently increase or decrease the number of
elements in an array. If you are uncertain of the exact number of elements the array may need to contain
at runtime, you may want to create an array that can handle the most extreme case you expect the
document to encounter at runtime. Note however that increasing the size of the array increases the
memory required for the document, and that it is good programming practice not to create arrays that are
larger than what the document requires to execute properly. An array in PlanetPress Design can have a
maximum of 65,535 elements.
You define an array using the define() command, and assign values to individual elements using the
assignment operator (:=), the set() command or the put() command. You retrieve the value of an
individual element using either the get() command, or the name of the array followed by the position of
that element in the array. The position is an integer value starting at 0 for the first element of the array,
and incrementing by one for each additional element. See “Define (procedure)” on page 83, “Set
(procedure)” on page 136, “Put (procedure)” on page 127, and “Get (function)” on page 100.
As an example, consider &tax_rates, an integer array containing five elements (10 20 30 40 50). You
define the array as follows:
You can use any of the following to change the value of the third element from 30 to 32.
&tax_rates[2] := 32
&tax_rates, 2, 32
put( &tax_rates, 2, 32 )
You can use any of the following to reference the third element in the array:
&tax_rates[2]
get(&tax_rates, 2)
For example:
&due := mul( &gross,&tax_rates[2] )
&due := mul( &gross,get(&tax_rates,2) )
Directory
The directory type is a type of string array in which each element in the array contains a pathname. All
pathnames in the array reference a file in the same folder. The number of elements in the array, and the
initial value of each element are both determined dynamically at the time the array is created. You specify
the folder, and the filter you want to apply to the list of files in that folder. When PlanetPress Talk creates
the array, it locates the folder you specified, applies the filter to the list of files that folder contains, and
then for each file that meets the filter criteria, adds its pathname to the directory array. Pathnames may
be either printer pathnames or host pathnames.
You can subsequently set the value of any of the elements in the array, as you would for any element in an
array of type string.
Code Sample Example 1
Example 1 uses a directory on the root drive of a printer.
Example 1
define(&MyVar,directory,'*') %root of the printer
11
1
PlanetPress Talk Basics
Code Sample Example 2
Example 2 defines a directory array in which each element in the array contains a pathname to an image
in EPS format in the folder c:\images.
Example 3 prints a list of all of the pathnames in that array.
Example 3
define( &i, integer, 0 )
for( &i, 0, 1, length( &image_paths ) - 1 )
show( &image_paths[&i] )
crlf( 0.16 )
endfor()
Code Sample Example 4
Example 4 displays each of the images referenced by the array, at a resolution of 100 pixels per inch, scaled
to a 'best fit' with a one-inch by one-inch rectangle.
12
Example 4
for( &i, 0, 1, length( &image_paths ) - 1 )
showbitmap( &image_paths[&i], 100, 1, 1 )
crlf( epsheight( &image_paths[&i] ) )
endfor()
Code Sample Example 5
Example 5 prints either an image, or, if the image cannot be found, the pathname to the image.
Example 5
define( &i, integer, 1 )
if( resourcetype( &image_paths[&i] ) <> 0 )
showbitmap( &image_paths[&i], 300, 0, 0)
crlf( epsheight( &image_paths[&i] ) )
elseif()
show( &image_paths[&i] )
crlf( 0.16 )
endif()
Variables
What are variables?
A variable is a value that changes over time, that has a specific type, and a defined scope. Variables have
names to make it possible to reference them. All variable names in PlanetPress begin with an ampersand.
For example, &printermode.
Typ e Th e ty pe of a var iab le def ine s w hat kin d of dat a it contains and consequently what kinds of operations
you can perform on it. The following are the data types available in PlanetPress Talk: integer, measure,
currency, string, boolean, array, color array, and directory. See “Data Types” on page 8.
Scope The scope of a variable is the context in which it is available. There are two possible scopes: local and
global. A local scope means the variable is available only in the specific area of an object or group in which
it is defined, and a global scope means the variable is available anywhere you can enter PlanetPress Talk
code. The way you define a variable determines its scope. The variables you define using the define
command have a local scope limited to the area of the object or group in which you define them. The
variables you define as global variables in PlanetPress Design have a global scope. Global variables in
PlanetPress Design appear in the Global Variables area of TreeView.
There are a number of ways to use variables in documents. See the PlanetPress Design 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.
1System 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 Design. 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 welldefined context. There are currently two system variables with a local scope: &height and &width.
Both are local to a specific object, group, or page. The system initializes &height and &width to,
13
1
PlanetPress Talk Basics
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” on page 42 for a complete list of the system variables
available in PlanetPress Talk.
2 Global Variables
Global variables are variables that you define using the Global Variable Properties dialog box in
PlanetPress Design. Global variables appear in TreeView in PlanetPress Design. Global variables have a
global scope; you can reference global variables anywhere you can insert a PlanetPress Talk expression
in PlanetPress Design.
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 Talk define 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 variables 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.
14
You should never define a local variable with the same name as a system variable.
Runpage
What is a runpage?
A runpage is a normal page containing a PlanetPress Talk object that controls the execution of the pages
in the document. Although nothing prevents a runpage from containing printable elements, in most cases
it serves only to control the execution of the other pages in the document and does not itself print.
Using Foreign Language Text with PPtalk
Can PlanetPress Talk let me use foreign language text in PlanetPress Design?
You can use Text objects to display both static text and variable content, such as data selections, in the
same object. Text objects also let you mix foreign language text, such as Arabic, and European language
styles within the same object, although not in the same paragraph.
Adding Foreign Text
The Text objects dialog box lets you enter foreign language text, such as Arabic, directly in the Text area
(granted that the corresponding foreign language text feature is enabled in Windows).
Using Global Variables
If you use a Global variable containing a foreign language text string within a Text object, you must map
the characters included in that non-Unicode text string to UTF8. To do this, you must use the mapUTF8
function. You can do this by placing a PlanetPress Talk object above the Text object in the Document
Structure or in the Text object itself using the PlanetPress Talk Before properties.
Using Dynamic Data within Local Text Variables
You can add dynamic data to a Text object by using custom data selections. If you do so , you must use the
mapUTF8 function within the definition of each custom data selection.
Tex t Dir ection
A new setting was added to the paragraph options to enable right-to-left text display for paragraphs
associated with a foreign language text style.
A
B
C
A. Arabic style ; B. Right to left tex t option available when an Arabic style is selected ; C. Static tex t and data selection as edited
within the Text objects dialog box.
15
1
PlanetPress Talk Basics
Foreign Language Text within PlanetPress Talk Objects
You can use PlanetPress Talk objects to display either static text or variable content. You would typically
add a paragraph for static text or a simple field for variable information, such as a client’s name or address.
A. A PlanetPress Talk object created without defining a UTF8 paragraph ; B. Another PlanetPress Talk object, created this time
with UTF8 paragraph properties (the paragraph is justified on both sides)
If you need a string, that may contain variable content, you can use the ShowUTF8Left, ShowUTF8Center
and ShowUTF8Right commands. Note that if you choose to display a box around objects that include any of
these commands, the box may not be perfectly drawn. Pages that include many objects with these commands
will not display as fast as other pages.
If you need a paragraph, that may only contain static text, you must use the BeginUTF8Paragraph and
EndUTF8Paragraph procedures along with the ShowUTF8 command.
A
B
16
Loading...
+ 168 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.