Objectif Lune PlanetPress Talk - 6.0 Reference Guide

5 (1)
Objectif Lune PlanetPress Talk - 6.0 Reference Guide

Copyright Information

Copyright © 1994-2007 Objectif Lune Inc. All Rights Reserved.

No part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any other language or computer language in whole or in part, in any form or by any means, whether it be electronic, mechanical, magnetic, optical, manual or otherwise, without prior written consent of Objectif Lune Inc.

Objectif Lune Inc. disclaims all warranties as to this software, whether expressed or implied, including without limitation any implied warranties of merchantability, fitness for a particular purpose, functionality, data integrity or protection.

PlanetPress is a registered trademark of Objectif Lune Inc.

PostScript and Acrobat are registered trademarks of Adobe Systems Inc.

Pentium is a registered trademark of Intel Corporation.

Windows is a registered trademark of Microsoft Corporation.

Adobe, Adobe PDF Library, Adobe Acrobat, Adobe Distiller, Adobe Reader, Adobe Illustrator, Adobe Photoshop, Optimized Postcript Stream, the Adobe logo, the

Adobe PDF logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries.

Trademarks of other companies mentioned in this documentation appear for identification purposes only and are the property of their respective companies.

Title

PlanetPress Talk Reference Guide

 

 

Revision

6.1 8/17/07

 

 

OBJECTIF LUNE PLANETPRESS SUITE

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 Agreement 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 the appropriate following sections 9 or 10 “ADDITIONAL LICENSE 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 TERMS FOR OPTIMIZED POSTSCRIPT AND WINDOWS PRINTING 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 you fail to comply with any one of the terms of this Agreement. Upon termination, 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.

Objectif Lune’s and its suppliers’ liability and the exclusive remedy shall be, at Objectif Lune’s sole 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 DAM-

AGES 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 excluded.

17.U.S. GOVERNMENT RESTRICTED RIGHTS. - If a Licensed Application is acquired under the terms of a proposal or agreement with the United States Government 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 addition, if the Software is identified as 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.

Table of Contents

1 PlanetPress Talk Basics

1

Key Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Assumed Knowledge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 PlanetPress Talk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 PlanetPress Talk Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 The Elements of PlanetPress Talk. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 PlanetPress Talk Syntax. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Data Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Runpage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Using Foreign Language Text with PPtalk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

Detailed Directions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Learn PlanetPress Talk. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Integrate PlanetPress Talk into Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Define and Assign Values to Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Select Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Use Functions as Arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Debug Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Tips and Tricks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Code Samples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Print a variable number of copies of a page based on a value in the datastream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Store two lines of input data on one line of the data page. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Print a page n-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Print a line of text on odd-numbered pages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Determine the proper page to print based on the width of the data in the data page. . . . . . . . . . . . . . . . . . . . . . . . . . 27

2 PlanetPress Talk Editor

29

Key Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

PlanetPress Talk Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

PlanetPress Talk Editor Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

i

toc

Debugging Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Code Execution in the Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Detailed Directions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Enter a New Program in the Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Import or Export a Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Save a Program. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Print a Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Exit the PlanetPress Talk Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Show or Hide the Commands Area or Spy List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Adjust the Sizes of the Commands Area, Code Area and Spy List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Expand or Collapse Command Groups. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Enter Commands in the Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Use Command and Variable Name Completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

3 PlanetPress Talk Summary

41

Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 System Variables with Local Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 System Variables with Global Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 System Objects with Global Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Operators and Operator Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Assignment Operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Mathematical Operators and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 String Operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Boolean Operator Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Comparison Operators and Operator Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Conversion Operator Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 XML Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Foreign Language Procedures and Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

Loop and Condition Structures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Loop Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Condition Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Add a Comment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Work with Emulations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Work with Data Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Work with Database Records. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Select or Define a Data Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Execute Documents and Document Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Work with PostScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Work with PPDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Save and Restore the Current Graphics State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

ii

Work with Global Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Define and Assign Values to Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Work with Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Work with Bar Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Work with Images and Attachments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Work with Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Work with Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Work with Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Work with Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Work with Arrays and Color Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Draw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

4 Language Reference

61

Language Reference (Alphabetical) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 % (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 @ (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 @name (function/procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 @page (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 $element (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 + (operator & function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

– (operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 * (operator). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 / (operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 > (operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 >= (operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 < (operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 <= (operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 = (operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 := (operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 <> (operator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Add (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 And (Boolean operator function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Arc (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 ArcN (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 BeginParagraph … EndParagraph (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 BeginUTF8Paragraph … EndUTF8Paragraph (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 BitmapWidth/BitmapHeight (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Breakpoint (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 C128 (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

iii

toc

CallPPD (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Char (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 Ceil (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 ClearPage (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 ClosePath (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 Cos (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 CRLF (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Current (system object). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 currentiteration (variable) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 CurToStr (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 CurveTo/RCurveTo (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Date (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Define (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 DefineData (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 DefineImageIndex (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Div (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 DoForm (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 &EOJob (system variable) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 EPSWidth/EPSHeight (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Eq (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 ExecPage (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Exit (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Field (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 FieldCount (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 FieldName (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Fill (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Find (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 &FirstSide (system variable). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 FloatToInt (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 FloatToStr (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 For… EndFor (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Function @name (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 GE (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Get (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 GetBlack (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 GetCyan (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 GetMagenta (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 GetNextDataPage(procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 GetYellow (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 GRestore (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 GSave (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 GT (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104

iv

&Height (system variable) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 If (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 If … ElseIf… EndIf (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 IntToFloat (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 IntToStr (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 InStream... EndInStream (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 IsNumber (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 IsPageEmpty (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 iterationcount (variable) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 LE (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Left (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Length (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 LineTo/RLineTo (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 LowerCase (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 LT (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 MapUTF8 (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Margin (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 Mid (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Mod (function & procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 MoveTo/RMoveTo (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 Mul (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 NE (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Neg (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 Not (Boolean operator function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 Object $name()... EndObject (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Or (Boolean operator function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Ord (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 OutputDebugString (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 PassThrough (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 PDFPageCount (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 PDFWidth/PDFHeight (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 Physical (system object) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Pie (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 PixelHeight (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 PixelWidth (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 Pos (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 &PrinterMode (system variable) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Put (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 Random (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 Rectangle (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 RectFill (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 RectFillStroke (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 RectStroke (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130

v

toc

Repeat... Until (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 ResourceType (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 Right (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 RunPS (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Scale (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Search … EndSearch (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 SelectMedia (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 Set (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 SetAngle (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 SetBodyText (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 SetDash(procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 SetDataPage(procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 SetEmailAddress (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 SetEmailSubject (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 SetEmulation(procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 SetFaxInformation (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 SetFaxNumber (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 SetFillColor (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 SetStyle (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 SetStyleExt (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 SetImageIndex (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 SetLineWidth (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 SetLPP(procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 SetPDFBookmark (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 SetStrokeColor (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 Show / ShowCenter / ShowRight (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 ShowBarCode (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 ShowBitmap (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 ShowEPS (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 ShowLeftRight (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 ShowPage (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 ShowPDF (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 ShowUTF8 (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 ShowUTF8Left / ShowUTF8Right / ShowUTF8Center (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 Sin (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 StopJob (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 Store (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 &Str (system variable) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 StringReplace (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 StringWidth (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 StringWidthUTF8 (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 Strip (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 Stroke (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156

vi

StrokeAndFill (procedure). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 StrToCur (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 StrToFloat (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 StrToInt (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 Sub (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 SubRecCount (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 System (system object) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Time (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Translate (procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 Trim (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 TrimLeft (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 TrimRight (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 UpperCase (function). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 &Width (system variable) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 XOr (Boolean operator function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 xmlCount() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 xmlGet() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 xmlResetRoot(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 xmlSetRoot(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166

Appendix A: Conversion Tables

167

ASCII Conversion Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 Points to Inches or Centimeters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 Points to Inches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 Points to Centimeters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 Line Height as a Function of Lines Per Unit (LPU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 Line Height as a Function of Lines Per Inch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Line Height as a Function of Lines Per Centimeter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175

Index

177

vii

toc

viii

PlanetPress Talk Basics

PlanetPress Talk is a complete scripting language that opens the door to more powerful

and sophisticated documents.

Summary

Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Key Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Detailed Directions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Code Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

Overview

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 PlanetPress Talk Language Reference assume?

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

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)

 

Set the style for the data selection to the default style

 

 

 

margin(0,0.167)

 

Set the offset for the text, relative to the top left of the object.

 

 

 

rmoveto(stringwidth('

'),0)

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.

 

 

 

rmoveto(neg(stringwidth('

')),0)

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.

 

 

 

show(@(1,1,12))

 

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 PlanetPress Talk Language Reference use?

The PlanetPress Talk Language Reference uses the following terms:

Term:

Is:

 

 

command

A generic term that encompasses operators, functions, procedures, condition structures,

 

and loop structures.

 

 

expression

A piece of PlanetPress Talk code that includes at least one command and is at most one line

 

in length. For example:

 

&area := (&width * &height)

statement

A single line of PlanetPress Talk code. For example:

 

define(&max, integer, strtoint(@(1,1,4)))

script or

A sequence of one or more lines of PlanetPress Talk code, executed sequentially. For

program

example the following script draws a filled shape:

 

moveto(1,1)

 

lineto(1.5,2)

 

curveto(1,1,1,3,0.5,2)

 

closepath()

 

stroke()

4

The Elements of PlanetPress Talk

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:

 

 

Variables

A variable is a value that changes over time. See “Variables” on page 13.

 

 

System objects

An object is a set of related system variables. For example the physical system object

 

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 &physical.x

 

references the x coordinate system variable in the physical system object.

 

 

Operators and

An operator is a symbol that performs a common operation. For example, the + is an

Operator functions

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 add

 

command is an operator function. Both operators and operator functions operate on one or

 

more operands. For example the add command operates on two measure or integer values

 

(the operands). See “Operators and Operator Functions” on page 44 for a complete list of all

 

operators and operator functions available in PlanetPress Talk.

 

 

Procedures

A procedure performs an action. For example the 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 rectangle procedure requires

 

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.

 

 

Functions

A function performs an action and returns a value. For example the inttostr function

 

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 inttostr command requires a single argument: the integer you

 

want to convert to a string; it returns a string and thus the inttostr function is of type string.

 

 

Loop structures

Repeat a sequence of one or more commands until a specified condition is met. See “Loop

 

Structures” on page 48.

 

 

Condition structures

Control when a sequence of one or more commands executes. See “Condition Structures” on

 

page 48.

 

 

Comments

Provide a means for embedding documentation in your code, or for commenting out lines

 

of code during debugging. See “% (procedure)” on page 62.

 

 

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(&current.line,&current.line + 1)

store(&current.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:

if( (pos('BLACK', strip(' ',@(36,25,58))) > 0 ), 'old', 'new')

The interpreter first evaluates the data selection function (@), then the strip function (strip), then the start position function (pos), and finally the if function.

@(36,25,58)

strip(' ',@(36,25,58))

(pos('BLACK', strip(' ',@(36,25,58)))

if( (pos('BLACK', strip(' ',@(36,25,58))) > 0 ), 'old', 'new')

Operator Precedence

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

1PlanetPress 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 recommended that you choose 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 Type

Example

 

 

Integer

3

 

 

Measure or Floating Point

3,2300987

 

 

Currency

5.25

 

 

String

Michel or $4,567.09

 

 

Boolean

Yes 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.

Integer

Limit

 

 

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.

Measure

Limit

 

 

Smallest on screen

1.5 * 10-45

Largest on screen

3.4 * 1038

Smallest PostScript

10-38

Largest PostScript

1038

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'.

String

Length, in characters

 

 

Maximum on screen

2147483647

 

 

Maximum PostScript

65535

 

 

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).

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.

10

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:

define( &tax_rates,arrayinteger,[10,20,30,40,50] )

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 2

define( &image_paths, directory, 'c:\\images\\*.EPS' )

Code Sample Example 3

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.

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] ) )

12

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.

Type The type of a variable defines what kind of data 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.

2Global 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.

3Local 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.

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.

14

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.

Text Direction

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 text option available when an Arabic style is selected ; C. Static text 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

B

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.

16

Loading...
+ 168 hidden pages