Guide to the DEC TextProcessingUtilityOrder Number: AA–PWCBD–TEApril 2001This manual introduces the DEC Text Processing Utility (DECTPU). Itis for exp
Mail Compaq Computer CorporationOSSG Documentation Group, ZKO3-4/U08110 Spit Brook Rd.Nashua, NH 03062-2698How To Order Additional DocumentationUse th
Lexical Elements of the DEC Text Processing Utility Language4.10 Lexical Keywords4.10.2 Specifying the Radix of Numeric ConstantsYou can specify const
5DEC Text Processing Utility ProgramDevelopmentPrevious chapters have described the lexical elements of the DECTPU language,such as data types, langua
DEC Text Processing Utility Program Development5.1 Creating DECTPU Programs• You can use executable statements either within procedures or outsideproc
DEC Text Processing Utility Program Development5.1 Creating DECTPU ProgramsOther possible reasons for a TPU$_STACKOVER condition are that you have too
DEC Text Processing Utility Program Development5.1 Creating DECTPU ProgramsExample 5–3 Sample DECTPU Programs! Program 1! This program consists of a s
DEC Text Processing Utility Program Development5.2 Programming in DECwindows DECTPU• Menu_bar• Popup_attached_db• Popup_dialog_box• Popup_menu• Pulldo
DEC Text Processing Utility Program Development5.2 Programming in DECwindows DECTPU5.2.3 Global Selection SupportGlobal selection in DECwindows is a m
DEC Text Processing Utility Program Development5.2 Programming in DECwindows DECTPU5.2.3.4 Response to Requests for Information About the Global Selec
DEC Text Processing Utility Program Development5.2 Programming in DECwindows DECTPU5.2.4.1 Background on DECwindows CallbacksA callback is a mechanism
DEC Text Processing Utility Program Development5.2 Programming in DECwindows DECTPU5.2.4.4 Internally Defined DECTPU Callback Routines with Widgets Not
bold text This text style represents the introduction of a new term or thename of an argument, an attribute, or a reason.italic text Italic text indic
DEC Text Processing Utility Program Development5.2 Programming in DECwindows DECTPU5.2.5 Using ClosuresWith DECwindows, you can specify a closure valu
DEC Text Processing Utility Program Development5.2 Programming in DECwindows DECTPUDECTPU converts the value you specify into the data type appropriat
DEC Text Processing Utility Program Development5.2 Programming in DECwindows DECTPUSetting ResourcesWhen you use the SET (WIDGET) built-in procedure t
DEC Text Processing Utility Program Development5.3 Writing Code Compatible with DECwindows EVE5.3 Writing Code Compatible with DECwindows EVEThis sect
DEC Text Processing Utility Program Development5.3 Writing Code Compatible with DECwindows EVE• Use the MB1 mouse button with the Shift key to extend
DEC Text Processing Utility Program Development5.4 Compiling DECTPU ProgramsTo see DECTPU messages while in EVE, use the BUFFER MESSAGEScommand. To re
DEC Text Processing Utility Program Development5.5 Executing DECTPU ProgramsAfter using the TPU command, suppose you used the following statement tocr
DEC Text Processing Utility Program Development5.5 Executing DECTPU ProgramsBuffer-change journaling works properly with Ctrl/C. Therefore, if you are
DEC Text Processing Utility Program Development5.6 Using DECTPU Startup Files5.6.3 Initialization FilesAn initialization file contains commands to be e
DEC Text Processing Utility Program Development5.6 Using DECTPU Startup Files5.6.5 Using Section FilesA section file is the binary form of a program th
DEC Text Processing Utility Program Development5.6 Using DECTPU Startup FilesThis command causes DECTPU to write the binary form of the file MY_APPLICA
DEC Text Processing Utility Program Development5.6 Using DECTPU Startup FilesFor example, to add a program called MY_CUSTOMIZATIONS.TPU to the EVEsect
DEC Text Processing Utility Program Development5.6 Using DECTPU Startup FilesExample 5–5 Source Code for Minimal Interface to DECTPU! MINI.TPU - minim
DEC Text Processing Utility Program Development5.6 Using DECTPU Startup FilesWhenever you want to add new procedures, variables, learn sequences, or k
DEC Text Processing Utility Program Development5.6 Using DECTPU Startup FilesIn EVE, the code that implements the initialization sequence callsTPU$LOC
DEC Text Processing Utility Program Development5.6 Using DECTPU Startup FilesIf you name your command file TPU$COMMAND.TPU and it is in yourdefault dir
DEC Text Processing Utility Program Development5.6 Using DECTPU Startup Files• Set formats for individual buffersEVE initialization files contain EVE c
DEC Text Processing Utility Program Development5.6 Using DECTPU Startup Files5.6.7.2 Using an EVE Initialization File During an Editing SessionTo exec
DEC Text Processing Utility Program Development5.7 Debugging DECTPU Programs5.7 Debugging DECTPU ProgramsThis section discusses the options you have f
DEC Text Processing Utility Program Development5.7 Debugging DECTPU ProgramsAfter setting breakpoints, use the GO command to switch control of executi
1Overview of the DEC Text Processing UtilityThis chapter presents information about the DEC Text Processing Utility(DECTPU). The chapter includes the
DEC Text Processing Utility Program Development5.7 Debugging DECTPU ProgramsTo compile all code in the buffer, use the EXTEND ALL command or use theCO
ASample DECTPU ProceduresThe following DECTPU procedures are samples of how to use DECTPU toperform certain tasks. These procedures show one way of us
Sample DECTPU ProceduresA.1 Line-Mode EditorExample A–1 (Cont.) Line-Mode Editing!Top of buffer command["T"]:POSITION (BEGINNING_OF (CURRENT
Sample DECTPU ProceduresA.2 Translation of Control CharactersExample A–2 (Cont.) Procedure to Display Control Characterstranslate_array := CREATE_ARRA
Sample DECTPU ProceduresA.2 Translation of Control CharactersExample A–2 (Cont.) Procedure to Display Control Characters!! This procedure controls the
Sample DECTPU ProceduresA.2 Translation of Control CharactersExample A–2 (Cont.) Procedure to Display Control CharactersLOOPCtrl_char_range := SEARCH_
Sample DECTPU ProceduresA.3 Restoring Terminal Width Before Exiting from DECTPUA.3 Restoring Terminal Width Before Exiting from DECTPUExample A–3 comp
Sample DECTPU ProceduresA.4 Running DECTPU from an OpenVMS SubprocessA.4 Running DECTPU from an OpenVMS SubprocessExample A–4 shows one way of running
BDECTPU Terminal SupportThis appendix lists the terminals that support screen-oriented editing anddescribes how differences among these terminals affe
Overview of the DEC Text Processing Utility1.1 Description of DECTPU• Free or bound cursor motion• Learn sequences• Pattern matching• Key definition• P
DECTPU Terminal SupportB.1 Using Screen-Oriented Editing on Supported Terminals132-Column ModeOnly terminals that set the DEC_CRT mode bit and the adv
DECTPU Terminal SupportB.1 Using Screen-Oriented Editing on Supported TerminalsB.1.2 SET TERMINAL CommandWhen you use the SET TERMINAL command to spec
DECTPU Terminal SupportB.3 Using Terminal WrapExample B–1 DCL Command Procedure for SET TERM/NOWRAP$ SET TERM/NOWRAP$ ASSIGN/USER SYS$COMMAND SYS$INPU
CDECTPU Debugger CommandsYou can use the following commands for debugging once you have set breakpoints,compiled code, and started execution.ATTACH pr
DECTPU Debugger CommandsSET WINDOW top, lengthPlaces the top of the debugger window at the line number specified by the topparameter. Extends the windo
IndexA@ command, 5–27Abortresulting from exceeding virtual address space,2–8ABORT statement, 4–24, 4–29 to 4–30Active editing point, 3–4Algorithmfor n
/CREATE qualifier, 2–11CREATE_WIDGET built-in procedureusing to specify callback routine, 5–8using to specify resource values, 5–11CREATE_WINDOW built-
ENDIF statement, 4–20 to 4–21ENDLOOP statement, 4–20ENDMODULE statement, 4–14ENDON_ERROR statement, 4–23 to 4–28ENDPROCEDURE statement, 4–15 to 4–19En
Journaling (cont’d)layered application control, 2–6using both keystroke and buffer-changejournaling, 2–7"journaling" string constant paramet
Pattern (cont’d)execution, 3–16expression, 4–11linking (&), 3–13operators, 3–13searching, 3–10Pattern assignmentpartial (@), 3–14PATTERN data type
Overview of the DEC Text Processing Utility1.2 Description of DECwindows DECTPU1.2.1 DECwindows DECTPU and DECwindows FeaturesThe DECwindows environme
Showing version number, 5–2SHOW_BUFFER variable, 5–24Source files for EVE, 2–3Startup files, 2–2 to 2–3, 5–17 to 5–27command file, 2–2definition, 2–2initi
WWidgetlisting of, 5–4WIDGET data type, 3–22Widget resourcesdata types of, 5–10 to 5–11specifying, 5–10Windowcreating, 3–23current, 3–24definition, 3–2
Overview of the DEC Text Processing Utility1.2 Description of DECwindows DECTPUThe DECwindows version of DECTPU does not provide access to all of thef
Overview of the DEC Text Processing Utility1.3 Description of EVEFigure 1–2 DECTPU as a Base for User-Written InterfacesZK−6544−GED E C T
Overview of the DEC Text Processing Utility1.4 DECTPU Language1.4.1 Data TypesThe DECTPU language has an extensive set of data types. You use data typ
Overview of the DEC Text Processing Utility1.4 DECTPU Language1.4.5 User-Written ProceduresYou can write your own procedures that combine DECTPU langu
© 2001 Compaq Computer CorporationCompaq, VAX, VMS and the Compaq logo Registered in U.S. Patent and Trademark Office.OpenVMS is a trademark of Compaq
Overview of the DEC Text Processing Utility1.6 Learning Path for DECTPU1.6 Learning Path for DECTPUThe suggested path for learning to use DECTPU is to
2Getting Started with DECTPUThis chapter describes the following:• Invoking DECTPU on OpenVMS systems• Invoking DECTPU from a DCL command procedure• I
Getting Started with DECTPU2.1 Invoking DECTPU on OpenVMS Systems2.1.1 Default File SpecificationsTable 2–1 lists the default TPU and EVE file specificat
Getting Started with DECTPU2.1 Invoking DECTPU on OpenVMS SystemsNoteWhen you invoke DECTPU with the /NOSECTION qualifier, DECTPUdoes not use any binar
Getting Started with DECTPU2.2 Invoking DECTPU from a DCL Command ProcedureExample 2–1 shows a DCL command procedure that ‘‘remembers’’ the last fileth
Getting Started with DECTPU2.2 Invoking DECTPU from a DCL Command ProcedureExample 2–3 DCL Command Procedure INVISIBLE_TPU.COM! This command procedure
Getting Started with DECTPU2.3 Invoking DECTPU from a Batch Job2.3 Invoking DECTPU from a Batch JobIf you want your edits to be made in batch rather t
Getting Started with DECTPU2.4 Using Journal Files2.4.1 Keystroke JournalingIn keystroke journaling, DECTPU keeps track of each keystroke made duringa
Getting Started with DECTPU2.4 Using Journal Files2.4.3 Buffer-Change Journal File-Naming AlgorithmBy default, DECTPU creates the buffer-change journa
Getting Started with DECTPU2.5 Avoiding Errors Related to Virtual Address SpaceDECTPU keeps strings in a different virtual pool than it does other mem
ContentsPreface ... ix1 Overview of the DEC Text Processing Utility1.1 Description of DECTPU
Getting Started with DECTPU2.6 Using OpenVMS EDIT/TPU Command QualifiersThe choice of character set also affects how your text appears when printed. Fo
Getting Started with DECTPU2.6 Using OpenVMS EDIT/TPU Command QualifiersBy default, DECTPU tries to read a command file called TPU$COMMAND.TPUin your de
Getting Started with DECTPU2.6 Using OpenVMS EDIT/TPU Command QualifiersBy default, EVE creates a new file if the specified input file does not exist. If
Getting Started with DECTPU2.6 Using OpenVMS EDIT/TPU Command QualifiersThe /NODISPLAY qualifier causes DECTPU to run without using the screendisplay an
Getting Started with DECTPU2.6 Using OpenVMS EDIT/TPU Command Qualifiers2.6.7 /INTERFACEThe /INTERFACE qualifier determines the interface or screen disp
Getting Started with DECTPU2.6 Using OpenVMS EDIT/TPU Command Qualifiers$ EDIT/TPU/NOJOURNAL memo.txtIf you are developing an application layered on DE
Getting Started with DECTPU2.6 Using OpenVMS EDIT/TPU Command QualifiersIf you invoke EVE and do not specify /MODIFY, /NOMODIFY, /READ_ONLY, or/NOWRITE
Getting Started with DECTPU2.6 Using OpenVMS EDIT/TPU Command QualifiersUsing /NOOUTPUT, you can develop an application that lets you control theoutput
Getting Started with DECTPU2.6 Using OpenVMS EDIT/TPU Command Qualifiers2.6.12 /RECOVER/RECOVER/NORECOVER (default)The /RECOVER qualifier determines whe
Getting Started with DECTPU2.6 Using OpenVMS EDIT/TPU Command Qualifiers$ EDIT/TPU/RECOVER/JOURNAL=save.TJL letter.datIn EVE, you can use /RECOVER to r
2.6.8 /JOURNAL. . ... 2–142.6.9 /MODIFY . . . ... 2–152.6.10 /OUTPUT
Getting Started with DECTPU2.6 Using OpenVMS EDIT/TPU Command QualifiersIf you specify the /NOSECTION qualifier, DECTPU does not load a section file.Unle
3DEC Text Processing Utility Data TypesA data type is a group of elements that ‘‘belong together’’; the elements are allformed in the same way and are
DEC Text Processing Utility Data Types3.1 Array Data Type3.1 Array Data TypeAn array is a structure for storing and manipulating a group of elements.
DEC Text Processing Utility Data Types3.1 Array Data Typeint_array := CREATE_ARRAY (10, 1);int_array {1} := "Store a string in the first element&
DEC Text Processing Utility Data Types3.2 Buffer Data TypeIn this statement, my_buf is the identifier for the variable my_buf. The string"my_buffe
DEC Text Processing Utility Data Types3.3 Integer Data TypeDECTPU also supports binary, octal, and hexadecimal integers. Binary integersare preceded b
DEC Text Processing Utility Data Types3.4 Keyword Data TypeTable 3–1 shows the correspondence between keywords used as DECTPUkey names and the keys on
DEC Text Processing Utility Data Types3.4 Keyword Data TypeTable 3–1 (Cont.) Keywords Used for Key NamesDECTPU Key NameVT400, VT300, VT200Series Key V
DEC Text Processing Utility Data Types3.5 Learn Data TypeTo enable your user-written DECTPU procedures to work successfully withlearn sequences, you m
DEC Text Processing Utility Data Types3.6 Marker Data TypeA marker is bound if there is a character in the position marked by the editingpoint at the
4.4 Identifiers . ... 4–54.5 Variables . . ... 4–54.6 Constan
DEC Text Processing Utility Data Types3.6 Marker Data Type• ERASE_LINE• MOVE_HORIZONTAL• MOVE_TEXT• MOVE_VERTICAL• SELECT• SELECT_RANGE• SPLIT_LINEExa
DEC Text Processing Utility Data Types3.7 Pattern Data TypeTo create a pattern, use DECTPU pattern operators (+, &, |, @) to connect any ofthe fol
DEC Text Processing Utility Data Types3.7 Pattern Data Typefor the pattern, the built-in returns a range that contains the text that matchesthe patter
DEC Text Processing Utility Data Types3.7 Pattern Data Type3.7.3 Using Pattern OperatorsThe following are the DECTPU pattern operators:• Concatenation
DEC Text Processing Utility Data Types3.7 Pattern Data TypeGiven this sequence of definitions, a search for pat_var succeeds if DECTPUencounters the fo
DEC Text Processing Utility Data Types3.7 Pattern Data Typepat1 := "abc" + (arb(2) @ var1) + remain;SEARCH or SEARCH_QUIETLY also assigns to
DEC Text Processing Utility Data Types3.7 Pattern Data TypeGiven this definition, the following patterns match the same text but are notequal:pat1 := L
DEC Text Processing Utility Data Types3.7 Pattern Data Type3.7.6 Anchoring a PatternAnchoring a pattern forces SEARCH or SEARCH_QUIETLY to match thean
DEC Text Processing Utility Data Types3.8 Process Data Type3.8 Process Data TypeThe CREATE_PROCESS built-in procedure returns a value of the process d
DEC Text Processing Utility Data Types3.10 Range Data Type3.10 Range Data TypeA range contains all the text between (and including) two markers. You c
5.2.3 Global Selection Support ... 5–65.2.3.1 Difference Between Global Selection and Clipboard . ... 5–65.2.3
DEC Text Processing Utility Data Types3.10 Range Data TypeThe following example assigns a value of the range data type to the variable x:x := CREATE_R
DEC Text Processing Utility Data Types3.11 String Data TypeThe maximum length for a string is 65,535 characters. A restriction of theDECTPU compiler i
DEC Text Processing Utility Data Types3.12 Unspecified Data TypeTo give a variable the data type unspecified, assign the predefined constantTPU$K_UNSPECI
DEC Text Processing Utility Data Types3.14 Window Data Type3.14.1 Defining Window DimensionsWindows are defined in lines and columns. In EVE, all window
DEC Text Processing Utility Data Types3.14 Window Data Type3.14.3 Displaying Window ValuesWhen you use the CREATE_WINDOW built-in procedure to create
DEC Text Processing Utility Data Types3.14 Window Data TypeFor more information on the cursor position in a window and the POSITIONbuilt-in procedure,
DEC Text Processing Utility Data Types3.14 Window Data Type3.14.8 Terminals That Do Not Support WindowsDECTPU supports windows only for ANSI character
4Lexical Elements of the DEC Text ProcessingUtility Language4.1 OverviewA DECTPU program is composed of lexical elements. A lexical element may bean i
Lexical Elements of the DEC Text Processing Utility Language4.3 Character Sets4.3 Character SetsWhen you invoke DECTPU, you can use one of the followi
Lexical Elements of the DEC Text Processing Utility Language4.3 Character Sets4.3.2 ISO Latin1 Character Set (ISO_LATIN1)The ISO Latin1 Character Set
A Sample DECTPU ProceduresA.1 Line-Mode Editor ... A–1A.2 Translation of Control Characters ...
Lexical Elements of the DEC Text Processing Utility Language4.3 Character SetsFor example:GOLD 27 GOLD Specins4.3.5 DECTPU SymbolsCertain symbols have
Lexical Elements of the DEC Text Processing Utility Language4.4 Identifiers4.4 IdentifiersIn DECTPU, identifiers are used to name programs, procedures, k
Lexical Elements of the DEC Text Processing Utility Language4.5 VariablesThe global variable user_tab_char is assigned a value when the procedureuser_
Lexical Elements of the DEC Text Processing Utility Language4.6 ConstantsExample 4–2 (Cont.) Global and Local Constant DeclarationsPROCEDURE user_hell
Lexical Elements of the DEC Text Processing Utility Language4.7 OperatorsTable 4–5 (Cont.) DECTPU OperatorsType Symbol Description+ Pattern concatenat
Lexical Elements of the DEC Text Processing Utility Language4.8 Expressions• You can mix data types when using the not equal (<>) and equal (=)r
Lexical Elements of the DEC Text Processing Utility Language4.8 ExpressionsThere are four types of DECTPU expressions:• Arithmetic• Relational• Patter
Lexical Elements of the DEC Text Processing Utility Language4.8 ExpressionsWhen used with markers, these operators test whether one marker is closerto
Lexical Elements of the DEC Text Processing Utility Language4.8 ExpressionsA true value in DECTPU is any odd integer; a false value is any even intege
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved Words• TPU$K_HELP_MODIFIED• TPU$K_MESSAGE_FACILITY• TPU$K_MESSAGE_ID• TPU$K_M
A–1 Line-Mode Editing ... A–1A–2 Procedure to Display Control Characters ... A–2A–3 Procedure
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved WordsENDCASE• Error statementON_ERRORENDON_ERROR• RETURN statement• ABORT sta
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved Words4.9.4.2 Procedure DeclarationThe PROCEDURE/ENDPROCEDURE declaration deli
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved WordsThe scope of procedure parameters is limited to the procedure in which t
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved WordsExample 4–5 Complex Procedure with Optional ParametersCONSTANTuser_warni
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved Words4.9.4.5 Procedures That Return a ResultProcedures that return a result a
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved WordsExample 4–8 Recursive ProcedurePROCEDURE user_reverseLOCAL temp_string;t
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved Words4.9.4.10 Assignment StatementThe assignment statement assigns a value to
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved WordsThe ENDIF statement specifies the end of a conditional statement.SyntaxIF
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved WordsSyntaxCASE case-selector [[FROMlower-constant-expr, TO upper-constant-ex
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved Words4.9.4.14 Error HandlingA block of code starting with ON_ERROR and ending
PrefaceThis manual discusses the DEC Text Processing Utility (DECTPU).Intended AudienceThis manual is for experienced programmers who know at least on
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved Words• RETURN—This language statement stops the execution of the procedure in
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved Words• If an error or warning is generated during a CALL_USER routine, ERROR
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved WordsExample 4–11 Procedure with a Case-Style Error HandlerPROCEDURE eve$lear
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved WordsIf the error or warning is trapped by a selector other than OTHERWISE,DE
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved Words• If the error is not due to you pressing Ctrl/C, the error message is w
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved WordsExample 4–13 Procedure That Returns a StatusPROCEDURE user_at_end_of_lin
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved WordsExample 4–15 Simple Error HandlerON_ERRORMESSAGE ("Aborting procedu
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved WordsSyntaxLOCAL variable-name [[,...]];Local variables may also be declared
Lexical Elements of the DEC Text Processing Utility Language4.9 Reserved WordsIf this code is included in TEMP.TPU, the following command demonstrates
Lexical Elements of the DEC Text Processing Utility Language4.10 Lexical Keywords4.10.1 Conditional CompilationThe following lexical keywords control
Komentarze do niniejszej Instrukcji