Guide to the DEC Text Processing Utility
Total Page:16
File Type:pdf, Size:1020Kb
Guide to the DEC Text Processing Utility Order Number: AA–PWCBD–TE April 2001 This manual introduces the DEC Text Processing Utility (DECTPU). It is for experienced programmers as well as new users of DECTPU. Revision/Update Information: This manual supersedes the Guide to the DEC Text Processing Utility, Version 3.1 Software Version: OpenVMS Alpha Version 7.3 OpenVMS VAX Version 7.3 The content of this manual has not changed sinced OpenVMS Version 7.1 Compaq Computer Corporation Houston, Texas © 2001 Compaq Computer Corporation Compaq, VAX, VMS and the Compaq logo Registered in U.S. Patent and Trademark Office. OpenVMS is a trademark of Compaq Information Technologies Group, L.P. in the United States and other countries. PostScript is a registered trademark of Adobe Systems Incorporated. Motif is a registered trademark of the The Open Group. All other product names mentioned herein may be the trademarks or registered trademarks of their respective companies. Confidential computer software. Valid license from Compaq or authorized sublicensor required for possession, use, or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor’s standard commercial license. Compaq shall not be liable for technical or editorial errors or omissions contained herein. The information in this document is provided "as is" without warranty of any kind and is subject to change without notice. The warranties for Compaq products are set forth in the express limited warranty statements accompanying such products. Nothing herein should be construed as constituting an additional warranty. ZK6018 The Compaq OpenVMS documentation set is available on CD-ROM. This document was prepared using DECdocument, Version 3.3-1b. Contents Preface ............................................................ ix 1 Overview of the DEC Text Processing Utility 1.1 Description of DECTPU ....................................... 1–1 1.1.1 DECTPU Features ........................................ 1–1 1.1.2 DECTPU and User Applications ............................. 1–2 1.1.3 DECTPU Environments .................................... 1–2 1.2 Description of DECwindows DECTPU ............................ 1–2 1.2.1 DECwindows DECTPU and DECwindows Features .............. 1–3 1.2.2 DECwindows DECTPU and the DECwindows User Interface Language ............................................... 1–4 1.3 Description of EVE . ........................................ 1–4 1.4 DECTPU Language . ........................................ 1–5 1.4.1 Data Types .............................................. 1–6 1.4.2 Language Declarations ..................................... 1–6 1.4.3 Language Statements ..................................... 1–6 1.4.4 Built-In Procedures ....................................... 1–6 1.4.5 User-Written Procedures . ................................ 1–7 1.5 Terminals Supported by DECTPU ............................... 1–7 1.6 Learning Path for DECTPU .................................... 1–8 2 Getting Started with DECTPU 2.1 Invoking DECTPU on OpenVMS Systems . ....................... 2–1 2.1.1 Default File Specifications . ................................ 2–2 2.1.2 Startup Files ............................................ 2–2 2.2 Invoking DECTPU from a DCL Command Procedure . ............... 2–3 2.2.1 Setting Up a Special Editing Environment ..................... 2–3 2.2.2 Creating a Noninteractive Application . ....................... 2–4 2.3 Invoking DECTPU from a Batch Job ............................. 2–6 2.4 Using Journal Files . ........................................ 2–6 2.4.1 Keystroke Journaling ...................................... 2–7 2.4.2 Buffer-Change Journaling . ................................ 2–7 2.4.3 Buffer-Change Journal File-Naming Algorithm . ............... 2–8 2.5 Avoiding Errors Related to Virtual Address Space ................... 2–8 2.6 Using OpenVMS EDIT/TPU Command Qualifiers ................... 2–9 2.6.1 /CHARACTER_SET ....................................... 2–9 2.6.2 /COMMAND ............................................. 2–10 2.6.3 /CREATE ............................................... 2–11 2.6.4 /DEBUG ................................................ 2–12 2.6.5 /DISPLAY ............................................... 2–12 2.6.6 /INITIALIZATION ........................................ 2–13 2.6.7 /INTERFACE ............................................ 2–14 iii 2.6.8 /JOURNAL . ............................................ 2–14 2.6.9 /MODIFY . ............................................ 2–15 2.6.10 /OUTPUT . ............................................ 2–16 2.6.11 /READ_ONLY ............................................ 2–17 2.6.12 /RECOVER . ............................................ 2–18 2.6.13 /SECTION . ............................................ 2–19 2.6.14 /START_POSITION . .................................... 2–20 3 DEC Text Processing Utility Data Types 3.1 Array Data Type ............................................ 3–2 3.2 Buffer Data Type ............................................ 3–3 3.3 Integer Data Type ........................................... 3–4 3.4 Keyword Data Type .......................................... 3–5 3.5 Learn Data Type ............................................ 3–7 3.6 Marker Data Type ........................................... 3–8 3.7 Pattern Data Type ........................................... 3–10 3.7.1 Using Pattern Built-In Procedures and Keywords ................ 3–12 3.7.2 Using Keywords to Build Patterns ............................ 3–12 3.7.3 Using Pattern Operators ................................... 3–13 3.7.3.1 + (Pattern Concatenation Operator) ........................ 3–13 3.7.3.2 & (Pattern Linking Operator) ............................ 3–13 3.7.3.3 | (Pattern Alternation Operator) ......................... 3–14 3.7.3.4 @ (Partial Pattern Assignment Operator) ................... 3–14 3.7.3.5 Relational Operators ................................... 3–15 3.7.4 Compiling and Executing Patterns ........................... 3–16 3.7.5 Searching for a Pattern .................................... 3–16 3.7.6 Anchoring a Pattern . .................................... 3–17 3.8 Process Data Type ........................................... 3–18 3.9 Program Data Type .......................................... 3–18 3.10 Range Data Type ............................................ 3–19 3.11 String Data Type ............................................ 3–20 3.12 Unspecified Data Type ........................................ 3–21 3.13 Widget Data Type ........................................... 3–22 3.14 Window Data Type ........................................... 3–22 3.14.1 Defining Window Dimensions ................................ 3–23 3.14.2 Creating Windows ........................................ 3–23 3.14.3 Displaying Window Values .................................. 3–24 3.14.4 Mapping Windows ........................................ 3–24 3.14.5 Removing Windows . .................................... 3–25 3.14.6 Using the Screen Manager .................................. 3–25 3.14.7 Getting Information on Windows . ............................ 3–25 3.14.8 Terminals That Do Not Support Windows . ................... 3–26 4 Lexical Elements of the DEC Text Processing Utility Language 4.1 Overview .................................................. 4–1 4.2 Case Sensitivity of Characters .................................. 4–1 4.3 Character Sets . ............................................ 4–2 4.3.1 DEC Multinational Character Set (DEC_MCS) .................. 4–2 4.3.2 ISO Latin1 Character Set (ISO_LATIN1) ....................... 4–3 4.3.3 General Character Sets .................................... 4–3 4.3.4 Entering Control Characters ................................ 4–3 4.3.5 DECTPU Symbols ........................................ 4–4 iv 4.4 Identifiers . ................................................ 4–5 4.5 Variables . ................................................ 4–5 4.6 Constants . ................................................ 4–6 4.7 Operators . ................................................ 4–7 4.8 Expressions ................................................ 4–8 4.8.1 Arithmetic Expressions .................................... 4–10 4.8.2 Relational Expressions ..................................... 4–10 4.8.3 Pattern Expressions ....................................... 4–11 4.8.4 Boolean Expressions ...................................... 4–11 4.9 Reserved Words ............................................. 4–12 4.9.1 Keywords ............................................... 4–12 4.9.2 Built-In Procedure Names . ................................ 4–12 4.9.3 Predefined Constants ...................................... 4–12 4.9.4 Declarations and Statements ................................ 4–13 4.9.4.1 Module Declaration .................................... 4–14 4.9.4.2 Procedure Declaration . ................................ 4–15 4.9.4.3 Procedure Names ...................................... 4–15 4.9.4.4 Procedure Parameters . ................................ 4–15 4.9.4.5 Procedures That Return a Result . ....................... 4–18 4.9.4.6 Recursive Procedures . ................................ 4–18 4.9.4.7 Local Variables ........................................ 4–19 4.9.4.8 Constants ............................................ 4–19 4.9.4.9 ON_ERROR