background image

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

Summary of Contents for DEC Text Processing Utility

Page 1: ...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 ...

Page 2: ...sion 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 a...

Page 3: ... 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 ...

Page 4: ...ling 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 1...

Page 5: ... Statements 4 19 4 9 4 10 Assignment Statement 4 20 4 9 4 11 Repetitive Statement 4 20 4 9 4 12 Conditional Statement 4 20 4 9 4 13 Case Statement 4 21 4 9 4 14 Error Handling 4 23 4 9 4 15 Procedural Error Handlers 4 24 4 9 4 16 Case Style Error Handlers 4 25 4 9 4 17 Ctrl C Handling 4 28 4 9 4 18 RETURN Statement 4 28 4 9 4 19 ABORT Statement 4 29 4 9 5 Miscellaneous Declarations 4 30 4 9 5 1 EQ...

Page 6: ...3 Found Range Selection 5 14 5 3 1 4 Relation of EVE Selection to DECwindows Global Selection 5 14 5 4 Compiling DECTPU Programs 5 14 5 4 1 Compiling on the EVE Command Line 5 15 5 4 2 Compiling in a DECTPU Buffer 5 15 5 5 Executing DECTPU Programs 5 15 5 5 1 Procedure Execution 5 16 5 5 2 Process Suspension 5 16 5 6 Using DECTPU Startup Files 5 17 5 6 1 Section Files 5 17 5 6 2 Command Files 5 17...

Page 7: ...g Blanks 3 10 4 1 Global and Local Variable Declarations 4 5 4 2 Global and Local Constant Declarations 4 6 4 3 Procedure That Uses Relational Operators on Markers 4 11 4 4 Simple Procedure with Parameters 4 16 4 5 Complex Procedure with Optional Parameters 4 17 4 6 Procedure That Returns a Result 4 18 4 7 Procedure Within Another Procedure 4 18 4 8 Recursive Procedure 4 19 4 9 Procedure That Uses...

Page 8: ...EVE 2 6 2 3 Character Set Values You Can Set with CHARACTER_SET 2 10 3 1 Keywords Used for Key Names 3 6 3 2 Effects of Two String Reduction Operations 3 21 4 1 Categories of ASCII Character Set Characters 4 2 4 2 Categories of DEC Multinational Character Set Characters 4 2 4 3 Categories for ISO Latin1 Characters 4 3 4 4 DECTPU Symbols 4 4 4 5 DECTPU Operators 4 7 4 6 Operator Precedence 4 8 5 1 ...

Page 9: ...ter 2 describes how to invoke DECTPU Chapter 3 provides detailed information on DECTPU data types Chapter 4 discusses the lexical elements of DECTPU These include the character set identifiers variables constants and reserved words such as DECTPU language statements Chapter 5 describes DECTPU program development Appendix A contains sample procedures written in DECTPU Appendix B describes terminals...

Page 10: ...her than a box A horizontal ellipsis in examples indicates one of the following possibilities Additional optional arguments in a statement have been omitted The preceding item or items can be repeated one or more times Additional parameters values or other information can be entered A vertical ellipsis indicates the omission of items from a code example or command format the items are omitted beca...

Page 11: ...the name of a file or the abbreviation for a system privilege Monospace text Monospace type indicates code examples and interactive screen displays In the C programming language monospace type in text identifies the following elements keywords the names of independently compiled external functions and files syntax summaries and references to variables or identifiers introduced in an example A hyph...

Page 12: ......

Page 13: ...r An interpreter Text manipulation routines Integrated display managers for the character cell terminal and DECwindows environments The Extensible Versatile Editor EVE interface which is written in DECTPU DECTPU is a procedural programming language that enables text processing tasks it is not an application 1 1 1 DECTPU Features DECTPU aids application and system programmers in developing tools th...

Page 14: ... on the OpenVMS VAX and OpenVMS Alpha operating systems You can display text in two environments Character cell terminals Bit mapped workstations running the DECwindows software 1 2 Description of DECwindows DECTPU DECTPU supports the Compaq DECwindows Motif for OpenVMS user interface The variant of DECTPU that supports window oriented user interfaces is known as DECwindows DECTPU The windows refe...

Page 15: ...ng techniques Use a DECTPU built in procedure that calls a DECwindows routine Examples of such DECTPU built in procedures include the following CREATE_WIDGET DELETE WIDGET MANAGE_WIDGET REALIZE_WIDGET SEND_CLIENT_MESSAGE SET CLIENT_MESSAGE SET DRM_HIERARCHY SET ICON_NAME SET ICON_PIXMAP SET MAPPED_WHEN_MANAGED SET WIDGET SET WIDGET_CALL_DATA SET WIDGET_CALLBACK UNMANAGE_WIDGET For more information...

Page 16: ...l For more information about using UIL files in conjunction with programs written in other languages see the VMS DECwindows Guide to Application Programming 1 3 Description of EVE The Extensible Versatile Editor EVE is the editor provided with DECTPU EVE is easy to learn and to use You can access many of EVE s editing functions by pressing a single key on the keypad EVE is also a powerful and effi...

Page 17: ...ommand files section files and initialization files The DEC Text Processing Utility Reference Manual contains information on layering applications on DECTPU 1 4 DECTPU Language You can view the DECTPU language as the most basic component of DECTPU To access the features of DECTPU write a program in the DECTPU language and then use the utility to compile and execute the program A program written in...

Page 18: ...apter 3 of this manual for a discussion of DECTPU data types 1 4 2 Language Declarations DECTPU language declarations include the following Module declaration MODULE IDENT ENDMODULE Procedure declaration PROCEDURE ENDPROCEDURE Constant declaration CONSTANT Global variable declaration VARIABLE Local variable declaration LOCAL See Chapter 4 of this manual for a discussion of DECTPU language declarat...

Page 19: ...Written Procedure This procedure moves the editing position to the top of the buffer PROCEDURE user_top POSITION BEGINNING_OF CURRENT_BUFFER MESSAGE Now in buffer GET_INFO CURRENT_BUFFER name ENDPROCEDURE Once you have compiled this procedure you can invoke it with the name user_top For information about writing procedures see Chapter 4 and Chapter 5 1 5 Terminals Supported by DECTPU DECTPU runs o...

Page 20: ...mplement your extensions Make sure that the DECTPU procedures you write do not conflict with procedures or variables that EVE uses To help you learn about the DECTPU language this manual contains examples of DECTPU procedures and programs Many of the descriptions of the built in procedures in the DEC Text Processing Utility Reference Manual also have a short sample procedure that uses the built in...

Page 21: ...DECTPU from DCL type the command EDIT TPU optionally followed by the name of your file EDIT TPU text_file lis This command opens TEXT_FILE LIS for editing If you are using the EVE editor Compaq suggests that you create a symbol like the following one to simplify invoking EVE EVE EDIT TPU When you invoke DECTPU with the preceding command you are usually placed in EVE the default editor However you ...

Page 22: ... EVE SECTION TPU SECTION You can modify this logical to use a different default editing interface 2 1 2 Startup Files Command files and section files can create or customize a DECTPU editor or application Initialization files can customize EVE or other layered applications by using EVE or other application specific commands settings and key bindings A command file is a file that contains DECTPU so...

Page 23: ...ction file when the customization is lengthy or complex or when you are creating an interface that is not layered on an existing editor or application You can use an initialization file only if your application supports the use of such a file The source files for EVE are in SYS EXAMPLES To see a list of the EVE source files type the following at the DCL prompt DIRECTORY SYS EXAMPLES EVE TPU If you...

Page 24: ...edited GOTO TPU_DONE REGULAR_INVOKE DEFINE USER SYS INPUT SYS COMMAND EDIT TPU last_file_edited TPU_DONE 2 2 2 Creating a Noninteractive Application In some situations you may want to put all of your editing commands in a file and have them read from the file rather than entering the commands interactively You may also want DECTPU to perform the edits without displaying them on the screen You can ...

Page 25: ...msg_text RETURN ENDON_ERROR replacement_count 0 LOOP src_range SEARCH str_or_pat FORWARD Search returns a range if found ERASE src_range Remove first string POSITION END_OF src_range Move to right place COPY_TEXT str2 Replace with second string replacement_count replacement_count 1 ENDLOOP ENDPROCEDURE global_search_replace Executable statements input_file GET_INFO COMMAND_LINE file_name main_buff...

Page 26: ...hange journaling You can use both keystroke and buffer change journaling at the same time except on DECwindows where you can use only buffer change journaling To turn on keystroke journaling the application uses the JOURNAL_OPEN built in The application layered on DECTPU not the DECTPU engine determines what kind of journaling is turned on and under what conditions Table 2 2 shows the journaling b...

Page 27: ...e enhanced SET JOURNALING built in to direct DECTPU to establish and maintain a separate journal file for any buffer or buffers created during the session The application programmer or user can also use the SET JOURNALING built in to turn journaling off or on for a given buffer during a session In the buffer s journal file DECTPU keeps track of the following record attributes and any changes made ...

Page 28: ... unused buffers Compaq recommends that you terminate the DECTPU session if you encounter either of these errors You can then start a new session with fewer or smaller buffers Alternatively you may want to put the work file on a disk that contains more free space Use one of the following methods to do this Redefine TPU WORK to point to the disk with more free space Invoke DECTPU with the WORK filen...

Page 29: ...dled by the application layered on DECTPU Some qualifiers in this category have their defaults set entirely by DECTPU some have their defaults set entirely by the layered application and some have their defaults set partly by each The following sections present the qualifiers in alphabetical order giving a detailed description of each The examples in the following sections show the qualifiers dire...

Page 30: ... set EDIT TPU CHARACTER_SET general If the character set you specify either with CHARACTER_SET or by defining TPU CHARACTER_SET is invalid the editing session is aborted returning you to the DCL level Table 2 3 shows the values you can specify with the CHARACTER_SET qualifier or the TPU CHARACTER_SET logical name Table 2 3 Character Set Values You Can Set with CHARACTER_SET Value Description DEC_M...

Page 31: ...and file use the NOCOMMAND qualifier If you usually invoke DECTPU without a command file define a symbol similar to the following EVE EDIT TPU NOCOMMAND Using NOCOMMAND when you do not want to use a command file decreases startup time by eliminating the search for a command file If you specify a command file that does not exist DECTPU terminates the editing session and returns you to the DCL comma...

Page 32: ...ile other than the default use the DEBUG qualifier and specify the device directory and file name of the debugger to be used If you specify only the file name DECTPU searches SYS SHARE for the file You can define the logical name TPU DEBUG to specify a file that contains a debugger program Once you define this logical name using DEBUG without specifying a file calls the file specified by TPU DEBUG...

Page 33: ...wing call in the application x GET_INFO COMMAND_LINE initialization The preceding call returns 1 if INITIALIZATION was specified 0 otherwise To fetch the name of the initialization file specified on the command line use the following call x GET_INFO COMMAND_LINE initialization_file For more information on GET_INFO see the DEC Text Processing Utility Reference Manual If you do not specify any form ...

Page 34: ...or each buffer created during the session The application layered on DECTPU is responsible for processing this qualifier To determine whether you specified JOURNAL on the DCL command line use the following call in the application x GET_INFO COMMAND_LINE journal The preceding call returns 1 if JOURNAL was specified 0 otherwise To determine whether buffer change journaling is turned on for a buffer ...

Page 35: ...e name both JOURNAL and RECOVER are used The name of the keystroke journal file is MEMO TJL EDIT TPU RECOVER JOURNAL memo tjl memo txt In buffer change journaling to recover the changes made to a specified buffer use the RECOVER_BUFFER built in procedure For more information on RECOVER_BUFFER see the DEC Text Processing Utility Reference Manual For more information on how to recover from an interr...

Page 36: ... returns 1 if OUTPUT was specified 0 otherwise To fetch the name of the output file specified on the command line use the following call x GET_INFO COMMAND_LINE output_file For more information on GET_INFO see the DEC Text Processing Utility Reference Manual If you do not specify any form of OUTPUT on the DCL command line DECTPU specifies OUTPUT but does not supply a default file specification In ...

Page 37: ...AND_LINE read_only This statement returns 1 if READ_ONLY or NOWRITE was explicitly specified on the command line To determine whether either NOREAD_ONLY or WRITE was used on the DCL command line use the following call in an application x GET_INFO COMMAND_LINE write This statement returns 1 if NOREAD_ONLY or WRITE was explicitly specified on the command line If both GET_INFO calls return false the ...

Page 38: ...TPU opens the journal file for output only If you specify RECOVER when invoking DECTPU with a layered application then when the built in procedure JOURNAL_OPEN is executed the keystroke journal file is opened for input and output DECTPU opens the input file to restore whatever commands it contains Then DECTPU continues to journal keystrokes for the rest of the editing session or until a statement ...

Page 39: ...penVMS default redefine TPU SECTION You can specify a different section file The preferred method is to define the logical name TPU SECTION to point to a section file other than the default file You can also supply a full file specification for the SECTION qualifier For example if your device is called DISK USER and your directory is called SMITH the following command causes DECTPU to read a secti...

Page 40: ...user interface and no keys are defined In this state the only way to exit from DECTPU is to press Ctrl Y Typically you use NOSECTION when you create your own layered DECTPU application without EVE as a base 2 6 14 START_POSITION START_POSITION line column START_POSITION 1 1 default The START_POSITION qualifier determines where the application layered on DECTPU positions the cursor 2 20 Getting Sta...

Page 41: ...ermits any variable to have any type of data as a value DECTPU has no declaration statement to restrict the type of data that you can assign to a variable DECTPU variables take on a data type when they are placed on the left hand side of an assignment statement The right hand side of the assignment statement determines the data type of the variable Although you can construct variables freely DECTP...

Page 42: ...e integer 1 is stored in the array element indexed by the marker mark1 mix_array CREATE_ARRAY mark1 MARK NONE mix_array mark1 1 mix_array Kansas Toto You can index dynamic elements with integers even if this means that the array ends up with more integer indexed elements than you specified when you created the array DECTPU does not process dynamically added integer indexed elements as quickly as i...

Page 43: ...xample the following statement deletes the element my_array fred my_array fred TPU K_UNSPECIFIED The following code fragment shows how you can find all the indexes in an array the_index GET_INFO the_array FIRST LOOP EXITIF the_index TPU K_UNSPECIFIED the_index GET_INFO the_array NEXT ENDLOOP Note DECTPU does not guarantee the order in which it will return the array indexes 3 2 Buffer Data Type A b...

Page 44: ... not mapped to a window on the screen The current buffer contains the active editing point The editing point can be different from the cursor position and often each is in a different location When the current buffer is associated with a visible window one that is mapped to the screen the editing point and the cursor position are usually the same At present a line in a buffer can contain up to 327...

Page 45: ...stance PAD SCROLLING STATUS_LINE As values returned by DECTPU built in procedures such as CURRENT_ DIRECTION KEY_NAME LAST_KEY READ_KEY and GET_INFO For example the call GET_INFO window status_video has the following keywords as possible return values BLINK BOLD NONE REVERSE SPECIAL_GRAPHICS UNDERLINE As pattern directives The following keywords fall into this category ANCHOR BUFFER_BEGIN BUFFER_E...

Page 46: ...4 PF4 KP0 KP1 KP9 0 1 9 0 1 9 Period Comma Minus Enter Enter Enter Up Up arrow Up arrow Down Down arrow Down arrow Left Left arrow Left arrow Right Right arrow Right arrow E1 Find E1 E2 Insert Here E2 E3 Remove E3 E4 Select E4 E5 Prev Screen E5 E6 Next Screen E6 Help Help F15 Do Do F16 F6 F7 F20 F6 F7 F20 NULL_KEY Ctrl space Ctrl space TAB_KEY Tab Tab RET_KEY Return Return DEL_KEY x Delete LF_KEY ...

Page 47: ...able x LEARN_BEGIN EXACT x LEARN_END All keystrokes that you enter between the LEARN_BEGIN and LEARN_END built in procedures are stored in the variable x The EXACT keyword specifies that when the learn sequence is replayed the input if any for the built in procedures READ_CHAR READ_KEY and READ_LINE if used in the learn sequence will be the same as the input entered when the learn sequence was cre...

Page 48: ...lder To create a marker use the MARK built in procedure The following example assigns a value of the marker data type to the variable x x MARK NONE After this statement is executed the variable x contains the character position where the editing point was located when the statement was executed The editing point is the point in a buffer at which most editing operations are carried out You can caus...

Page 49: ...n marked by the editing point the marker is bound even though you specify otherwise Once a marker becomes bound it remains bound throughout its existence To determine whether a marker is bound use the following GET_INFO call GET_INFO marker_variable bound DECTPU keeps track of the location of a free marker by measuring the distance between the marker and the character nearest to the marker If you ...

Page 50: ... a marker use the DELETE built in procedure with the marker as a parameter For example the following statement deletes the marker mark1 DELETE mark1 You can also set all variables referring to the marker to refer to something else for example tpu k_unspecified or 0 The following statement sets the variable mark1 to 0 mark1 0 If mark1 were the only variable referring to a marker that marker would b...

Page 51: ...string data type pat1 abc def The SEARCH and SEARCH_QUIETLY built in procedures accept such a string as a parameter A more complex pattern uses pattern built in procedures and existing patterns to form a new pattern The following example indicates that pat2 matches the string abc followed by the longest string that contains any characters from the string 12345 pat2 abc SPAN 12345 Pat2 matches the ...

Page 52: ...ch_range my_pat abc def match_range SEARCH my_pat FORWARD POSITION match_range 3 7 1 Using Pattern Built In Procedures and Keywords The following built in procedures return values of the pattern data type ANY ARB MATCH NOTANY SCAN SCANL SPAN SPANL See the DEC Text Processing Utility Reference Manual for a complete description of these pattern built in procedures 3 7 2 Using Keywords to Build Patte...

Page 53: ...the right pattern element is anchored to the left For example the following pattern matches only if there is a line in the searched text that ends with the string abc pat1 abc line_end If SEARCH or SEARCH_QUIETLY finds such a line the built in returns a range that contains the text abc and the end of the line Compaq recommends that you use the concatenation operator rather than the link operator u...

Page 54: ...er of the pattern elements separated by the alternation operator The following pattern matches either the string abc or the string xes pat1 abc xes If the text being searched contains text that matches both alternatives SEARCH or SEARCH_QUIETLY matches the earliest occurring match If two matches start at the same character SEARCH or SEARCH_QUIETLY matches the left element For example suppose you h...

Page 55: ...assignments only to those variables paired with pattern elements that are used in the complete match If a partial pattern assignment variable appears more than once in a pattern in places where it is legal for a partial pattern assignment to occur the last occurrence in the pattern determines what range SEARCH assigns to the variable For example with the search text abcdefg and the following patte...

Page 56: ...owing algorithm to find a match for a pattern 1 Put the internal marker that marks the search position at the starting position for the search The starting position is determined as follows If you do not specify where to search search the current buffer starting at the editing point If you specify a buffer or range where the search is to take place start at the beginning or end of the buffer or ra...

Page 57: ... ending with the characters xyz It does not matter what or how many characters or line breaks appear between the two sets of characters Since SEARCH or SEARCH_QUIETLY matches the first xyz it finds the text between the two sets of characters by definition does not contain the string xyz The second way to unanchor a pattern element is to use the special properties of the link operator While the con...

Page 58: ... value of the process data type to the variable x x CREATE_PROCESS main_buffer MAIL The first parameter specifies that the output from the process is to be stored in MAIN_BUFFER The string MAIL is the first command sent to the subprocess To pass commands to a subprocess use the SEND built in procedure as follows SEND MAIL x To pass the READ command to the Mail utility enter the following DECTPU st...

Page 59: ...kers used to create a range does not affect the range To convert the contents of a range to a string use either the STR or the SUBSTR built in procedure To remove a range use the DELETE built in procedure with the range as a parameter For example the following statement deletes the range range1 DELETE range1 You can also delete a range by removing all variable references to the range To do this se...

Page 60: ... type can contain any of the elements of the character sets mentioned previously To specify a string constant enclose the value in quotation marks In DECTPU you can use either the quotation mark or the apostrophe as the delimiter for a string The following statements assign a value of the string data type to the variable x x abcd x abcd To specify the quote character itself within a string type th...

Page 61: ...t COPY_TEXT _ 10 The string to be replicated must be on the left hand side of the operator For example the following DECTPU statement produces an error COPY_TEXT 10 _ To reduce a string specify the string to be modified then the subtraction operator and then the substring to be removed Table 3 2 shows the effects of two string reduction operations Table 3 2 Effects of Two String Reduction Operatio...

Page 62: ...ue DECwindows window Gadgets do not require as much memory to implement as widgets do In most cases you can use the same DECwindows DECTPU built ins on gadgets that you use on widgets For more information on widgets or gadgets see the OpenVMS overview documentation 3 14 Window Data Type A window is a portion of the screen that displays as much of the text in a buffer as will fit in the screen area...

Page 63: ...status line and scroll bar The maximum length of a window is the number of lines on your screen For example if your screen is 24 lines long the maximum size for a single window is 24 lines On the same size screen you can have a maximum of 24 visible windows if you do not use status lines or horizontal scroll bars If you use a status line and a horizontal scroll bar for each window the maximum numb...

Page 64: ... window is marked as visible and mapped The visible_top visible_bottom and visible_length of the window are calculated and stored Initially these values are the same as the original values that were calculated when the window was created See the last item in the next list Mapping a window to the screen may have the following side effects The newly mapped window may occlude other windows This happe...

Page 65: ...aving it appear on a terminal screen see Chapter 5 However if you use the DECTPU window capability to make your edits visible the screen manager controls the screen In the main control loop of DECTPU the screen manager is not called to perform its duties until all commands bound to the last key pressed have finished executing and all input in the type ahead buffer has been processed Upon completio...

Page 66: ...DISPLAY informs DECTPU that you do not expect the device from which you are issuing DECTPU commands to support screen oriented editing If one of the previous conditions exists and you do not specify the NODISPLAY qualifier DECTPU exits with an error condition You are using an unsupported device if logical name SYS INPUT points to an unsupported device such as a character cell terminal Appendix B c...

Page 67: ...his chapter describes the following DECTPU lexical elements Character set Identifiers Variables Constants Operators Expressions Reserved words Lexical keywords 4 2 Case Sensitivity of Characters The DECTPU compiler does not distinguish between uppercase and lowercase characters except when they appear as part of a quoted string For example the word EDITOR has the same meaning when written in any o...

Page 68: ...b line feed carriage return and bell 32 Space 33 64 Special characters such as the ampersand question mark equal sign and the numbers 0 through 9 65 122 The uppercase and lowercase letters A through Z and a through z 123 126 Special characters such as the left brace and the tilde 127 Delete The following sections discuss the types of character sets supported by DECTPU 4 3 1 DEC Multinational Chara...

Page 69: ...5 in the General Character Sets are not specific to any character set 4 3 4 Entering Control Characters There are two ways to enter control characters in DECTPU Use the ASCII built in procedure with the decimal value of the control character that you want to enter The following statement causes the escape character to be entered in the current buffer COPY_TEXT ASCII 27 Use the special functions pr...

Page 70: ... keyword or procedure name that is reserved to Compaq Right brace Closes array element index expression Equal sign Relational operator Greater than sign Relational operator Greater than or equal to sign Relational operator Slash Integer division operator Asterisk Integer multiplication operator Left bracket Begins case label Less than sign Relational operator Less than or equal to sign Relational ...

Page 71: ...f an assignment statement Following is an example of a variable assignment new_buffer CREATE_BUFFER new_buffer_name Compaq suggests that you establish some convention for naming variables so that you can distinguish your variables from the variables in the section file that you are using DECTPU allows two kinds of variables global and local Global variables are in effect throughout a DECTPU enviro...

Page 72: ...acter or a combination of characters delimited by apostrophes or quotation marks See the DEC Text Processing Utility Reference Manual for a complete description of how to quote strings in DECTPU Keywords are reserved words that have special meaning to the DECTPU compiler See Chapter 3 for a complete description of keywords With the CONSTANT declaration you can associate a name with a constant expr...

Page 73: ...ithmetic String Relational Pattern Logical Table 4 5 lists the symbols and language elements that DECTPU uses as operators Table 4 5 DECTPU Operators Type Symbol Description Arithmetic Addition unary plus Subtraction unary minus Multiplication Division String String concatenation String reduction String replication Relational Not equal to Equal to Less than Less than or equal to Greater than Great...

Page 74: ...nary unary Highest NOT AND OR XOR Lowest Expressions enclosed in parentheses are evaluated first You must use parentheses for correct evaluation of an expression that combines relational operators You can use parentheses in an expression to force a particular order for combining operands For example Expression Result 8 5 2 4 16 8 5 2 4 20 4 8 Expressions An expression can be a constant a variable ...

Page 75: ...ored in the variable pat1 pat1 LINE_BEGIN the REMAIN Whenever possible the DECTPU compiler evaluates constant expressions at compile time DECTPU built in procedures that can return a constant value given constant input are evaluated at compile time In the following example the variable fubar has a single string assigned to it fubar ASCII 27 0m Note Do not assume that the DECTPU compiler automatica...

Page 76: ...ults of division operations Expression Result 39 10 3 39 10 3 4 8 2 Relational Expressions A relational expression tests the relationship between items of the same data type and returns an integer result If the relationship is true the result is integer 1 if the relationship is false the result is integer 0 Use the following relational operators with any of the DECTPU data types Not equal operator...

Page 77: ... MESSAGE You are in the second half of the buffer ELSE MESSAGE You are in the first half of the buffer ENDIF ENDIF ENDIF ENDPROCEDURE 4 8 3 Pattern Expressions A pattern expression consists of the pattern operators combined with string constants string variables pattern variables pattern procedures pattern keywords or parentheses The following are valid pattern expressions pat1 LINE_BEGIN SPAN 012...

Page 78: ...ter the same name as that of a keyword the compiler issues a message notifying you that the local declaration or parameter temporarily supersedes the keyword In such a circumstance the keyword is said to be occluded See Chapter 3 and the DEC Text Processing Utility Reference Manual for more information on keywords 4 9 2 Built In Procedure Names The DECTPU language has many built in procedures that...

Page 79: ...quence of declarations and statements These declarations and statements control the action performed in a procedure or a program The following reserved words are the language elements that when combined properly make up the declarations and statements of DECTPU Module declaration MODULE IDENT ENDMODULE Procedure declaration PROCEDURE ENDPROCEDURE Repetitive statement LOOP EXITIF ENDLOOP Conditiona...

Page 80: ...ents for the module The procedure names generated by the compiler are module name_MODULE_IDENT and module name_MODULE_INIT respectively Syntax MODULE module name IDENT string literal declarations ON_ERROR ENDON_ERROR statement_1 statement_n ENDMODULE The declarations part of a module can include any number of global VARIABLE CONSTANT and PROCEDURE declarations The ON_ERROR ENDON_ERROR block if use...

Page 81: ...ept another ON_ERROR ENDON_ERROR block Statements that make up the body of a procedure must be separated with semicolons For example PROCEDURE version MESSAGE This is Version 1 020 ENDPROCEDURE This procedure writes the text This is Version 1 020 in the message area 4 9 4 3 Procedure Names A procedure name can be any valid identifier that is not a DECTPU reserved word Compaq suggests that you use ...

Page 82: ... int1 and int2 are replaced by the actual values that you supply The result of the addition is written to the message area PROCEDURE ADD int1 int2 MESSAGE STR int1 int2 ENDPROCEDURE For example call the procedure ADD and specify the values 5 and 6 as arguments as follows ADD 5 6 The string 11 is written to the message buffer Any caller of a procedure must use all required parameters to call it The...

Page 83: ...e_text IF flash_it THEN SLEEP 0 00 00 00 3 MESSAGE SLEEP 0 00 00 00 3 MESSAGE the_text ENDIF ENDPROCEDURE Caution Do not assume that the DECTPU compiler automatically evaluates parameters in the order in which you place them To avoid the need to rewrite code you should write as if this compiler optimization were already implemented If you need the compiler to evaluate parameters in a particular or...

Page 84: ...to use the DECTPU RETURN language statement followed by a value See Example 4 13 You can use a procedure that returns a result as a part of a conditional statement to test for certain conditions Example 4 7 shows the procedure in Example 4 6 within another procedure Example 4 7 Procedure Within Another Procedure PROCEDURE user_nested_procedure IF user_on_end_of_line 1 at the eol mark THEN MESSAGE ...

Page 85: ...nt PROCEDURE test LOCAL X EXECUTE X 3 MOVE_VERTICAL X ENDPROCEDURE In this fragment when the compiler evaluates the string X 3 the compiler assumes X is a global variable The compiler creates a global variable X if none exists and assigns the value 3 to the variable When the MOVE_VERTICAL built in procedure uses the local variable X the local variable has the value 0 and the MOVE_VERTICAL built in...

Page 86: ...statement as many times as you like When the EXITIF statement is true it causes a branch to the statement following the ENDLOOP statement Syntax EXITIF expression The expression is optional without it EXITIF always exits from the loop Any DECTPU language statement except an ON_ERROR statement can appear inside a LOOP ENDLOOP combination For example LOOP EXITIF CURRENT_OFFSET 0 temp_string CURRENT_...

Page 87: ... if this compiler optimization were already implemented If you need the compiler to evaluate all clauses of a conditional statement you should force the compiler to evaluate each clause before using the conditional statement To do so use each clause in an assignment statement before using it in a conditional statement For example suppose you want the compiler to evaluate both CLAUSE_1 and CLAUSE_2...

Page 88: ...ional FROM and TO clauses of a CASE statement are not required If FROM and TO clauses are not specified INRANGE and OUTRANGE labels refer to data between the minimum and maximum specified labels Example 4 9 shows a sample procedure that uses the CASE statement Example 4 9 Procedure That Uses the CASE Statement PROCEDURE grades answers READ_LINE Enter number of correct answers 5 answers INT answers...

Page 89: ... error and ERROR_TEXT is set to the message associated with the error or warning DECTPU places the message in the message buffer then resumes execution at the statement after the statement that generated the error or warning In a procedure the error handler must be placed at the beginning of a procedure after the procedure parameter list the LOCAL or CONSTANT declarations if present and before the...

Page 90: ...or statements at the beginning of a procedure These statements return control to the caller if the input on the command line of an interface is not correct Any warning or error status returned by a statement in the body of the procedure causes the error statements to be executed Example 4 10 Procedure That Uses the ON_ERROR Statement Gold 7 emulation command line processing PROCEDURE command_line ...

Page 91: ...urrently active procedures in their reverse calling order and returns to the wait for next key loop For other errors and warnings the appropriate error or warning message is written to the message buffer DECTPU resumes execution at the next statement after the statement that generated the error 4 9 4 16 Case Style Error Handlers Case style error handlers provide a number of advantages over procedu...

Page 92: ... with TPU _CONTROLC in the message buffer If an error or warning is generated during a CALL_USER routine ERROR is set to a keyword that represents the failure status of the routine ERROR_ LINE is set to the line number of the error and ERROR_TEXT is set to the warning or error message associated with the keyword DECTPU then processes the error handler that trapped the CALL_USER error in the same w...

Page 93: ...ot return to the calling procedure or program DECTPU performs the equivalent of the following sequence special_error_symbol 0 LEARN_ABORT RETURN FALSE If the error or warning is not trapped by any selector DECTPU writes the associated error or warning message in the message buffer Next DECTPU performs the equivalent of the following sequence special_error_symbol 0 LEARN_ABORT RETURN FALSE If an er...

Page 94: ...on that is running to prompt for a new command The ability to trap the Ctrl C is intended to allow a procedure to clean up and exit gracefully 4 9 4 18 RETURN Statement The RETURN statement causes a return to the procedure that called the current procedure or program The return is to the statement that follows the statement that called the current procedure or program You can specify an expression...

Page 95: ... the RETURN statement in an ON_ERROR section Example 4 14 Using RETURN in an ON_ERROR Section Attach to the parent process Used when EVE is spawned from DCL and run in a subprocess kept DECTPU The ATTACH command can be used for more flexible process control PROCEDURE eve_attach ON_ERROR IF ERROR TPU _NOPARENT THEN MESSAGE Not running DECTPU in a subprocess RETURN ENDIF ENDON_ERROR ATTACH ENDPROCED...

Page 96: ...ion file that you extend interactively you cannot make equivalences to procedures or variables defined in the base section file Syntax EQUIVALENCE synonym_name1 real_name1 synonym_name2 real_name2 Elements of the EQUIVALENCE Statement real_name A user defined global variable or procedure name If real_name is undefined DECTPU defines it as an ambiguous name This ambiguous name can become a variable...

Page 97: ...ar defined outside the module and some unbound code at the end of the file In each of these sections of code a local variable X is defined The variable is displayed using the MESSAGE built in procedure MODULE mmm IDENT mmm PROCEDURE bat Declare procedure bat in module mmm LOCAL X X is local to procedure bat X Within procedure bat within module mmm MESSAGE X ENDPROCEDURE End procedure bat LOCAL X X...

Page 98: ...or locally defined Global constants are constants declared outside procedure declarations Once a global constant has been defined it is set for the life of the DECTPU session An attempt to redefine a constant will succeed only if the constant value is the same Local constants are constants declared within a procedure You must specify a local CONSTANT declaration after the PROCEDURE statement and b...

Page 99: ..._expression as either a numeric constant or a defined global variable whose value is an integer Any odd value is true and any even value is false If the variable or constant contains a value that is odd the compiler compiles the code marked by THEN If the variable or constant contains a value that is even the compiler compiles the code marked by ELSE You do not have to put conditional compilation ...

Page 100: ... constant without an explicit radix specifier is assumed to be decimal The radix specifier may be in uppercase or lowercase The following are examples of correct numeric constants Many different ways of saying the same thing CONSTANT binary_constant b11111 CONSTANT octal_constant o37 CONSTANT decimal_constant 31 CONSTANT hex_constant x1f Compile time expressions work too CONSTANT negative_value x1...

Page 101: ...e procedure name eve main_window Many of the EVE variables and procedure names begin with eve The sample procedures and syntax examples in this book use uppercase letters for items that you can enter exactly as shown DECTPU reserved words such as built in procedures keywords and language statements are shown in uppercase Lowercase items in a syntax example or sample procedure indicate that you mus...

Page 102: ...SCREEN_UPDATER Ident DECTPU V3 1 1993 08 17 08 37 Timer Message working 24 System buffers and 1 User buffer 5 1 2 Complex Programs When writing complex DECTPU programs avoid the following practices Creating large procedures Creating large number of procedures Including a large number of executable statements that are not within procedures These practices if carried to extremes can cause the parser...

Page 103: ...at were used to create EVE See Section 5 6 for information on using a command file or section file to create or customize an application layered on DECTPU See the DEC Text Processing Utility Reference Manual for information on using the EVE BUILD module to layer applications on top of EVE 5 1 3 Program Syntax The rules for writing DECTPU programs are simple You must use a semicolon to separate eac...

Page 104: ...QUIT do DECTPU quit operation ENDPROCEDURE Program 5 This program is a collection of procedures that makes DECTPU accept e ex or exi as the command for a DECTPU exit operation PROCEDURE e EXIT do DECTPU exit operation ENDPROCEDURE PROCEDURE ex EXIT ENDPROCEDURE PROCEDURE exi EXIT ENDPROCEDURE 5 2 Programming in DECwindows DECTPU This section provides information about programming with DECTPU in th...

Page 105: ...PU only if and when it is possible to do so To make sure that DECwindows can assign input focus your application should use the GET_INFO SCREEN input_focus built in procedure If assignment of input focus to DECTPU is enabled DECTPU can receive input focus in the following circumstances DECwindows DECTPU grabs input focus The DECwindows session manager assigns input focus to DECTPU An application l...

Page 106: ...n procedures in the DEC Text Processing Utility Reference Manual Global selections are identified in DECTPU either as strings or keywords While DECwindows provides for many global selections applications conforming to the Motif Style Guide are concerned with only two selections the primary and secondary selections DECTPU provides a pair of keywords PRIMARY and SECONDARY to refer to these selection...

Page 107: ...PU responds with the string returned by the GET_INFO SYSTEM default_font built in procedure LINE_NUMBER DECTPU responds with the value of type span containing the record number where the select range starts and the record number where the select range ends TEXT or STRING DECTPU responds with the text of the select range as a string with each line break represented by a line feed Compaq recommends ...

Page 108: ...e SET WIDGET_CALLBACK built in to execute the program or learn sequence that was associated with the widget This program or learn sequence controls what the application does in response to the callback information passed by the DECTPU callback routines An application s callback routines are referred to as application level callback action routines The following sections present information on inte...

Page 109: ...the same callback program or learn sequence Therefore the callback program or learn sequence must have a mechanism for handling all possible callback reasons 5 2 4 6 Callable Interface Level Callback Routines If you are layering an application on DECTPU or on EVE you can specify callable interface level callback routines only if you are specifying a widget s callback resources in a User Interface ...

Page 110: ...e in any way the application programmer wishes DECTPU passes through to the application any closure value received as part of a callback DECwindows EVE provides an example of how an application can use closure values DECwindows EVE assigns a unique closure value to every widget instance that can be created during an EVE editing session Each closure value corresponds to something that EVE must do i...

Page 111: ...ndex is a string that corresponds to a valid resource name for the specified widget DECTPU also verifies that the data type of the value you specify is valid for the specified resource 5 2 6 2 Specifying a List as a Resource Value List box and file selection widgets manipulate lists For example the file selection widget manipulates a list of files The widget resource that stores such a list is spe...

Page 112: ...y For list box widgets or file selection widgets one element of the array receives another array that contains the list manipulated by the widget The indices of this array are of type integer The lowest index has the value 0 and each subsequent index is incremented by 1 The contents of the array elements are of type string When you create the index of the element that receives the widget s list yo...

Page 113: ...ION routine works and what parameters it takes see the code for this routine in SYS EXAMPLES EVE CORE TPU 5 3 1 1 Dynamic Selection When you press the Select key or invoke the SELECT command EVE creates a dynamic selection A dynamic selection expands and contracts as you move the text cursor Moving the text cursor away from the text already selected does not cancel the selection If you use the mou...

Page 114: ...on If EVE has a dynamic selection or a static selection active that selection is automatically designated as the primary global selection A found range selection is not designated as the primary global selection You can use the routine EVE SELECTION to get the text of the primary global selection when an application other than DECTPU owns the selection To do so the call to EVE SELECTION must be in...

Page 115: ...a string as the parameter for the EXECUTE built in procedure DECTPU first compiles and then executes the buffer range or string See the description of EXECUTE in the DEC Text Processing Utility Reference Manual The COMPILE built in procedure optionally returns a program data type If you want to use the program that you are compiling later in your session you can assign the program that is returned...

Page 116: ...cond intervals 5 5 1 Procedure Execution If you include procedure declarations as part of a program the procedure is compiled and the procedure name is added to the DECTPU list of procedures when you execute the program You invoke the procedure in one of the following ways Enter the name of the compiled procedure after the TPU Statement prompt from EVE Call the procedure from within a program or a...

Page 117: ...cate the section file DECTPU supplies a default directory of SYS SHARE and a default file type of TPU SECTION OpenVMS systems define the system wide logical name TPU SECTION as EVE SECTION so the default section file is the file that implements the EVE editor To override the OpenVMS default redefine TPU SECTION For more information on the SECTION qualifier see Section 2 6 13 5 6 2 Command Files A ...

Page 118: ...ocesses Startup Files When you invoke DECTPU by default DECTPU reads compiles and executes several files The sequence in which DECTPU performs these tasks is as follows 1 DECTPU loads into memory the specified or default section file unless you specify the NOSECTION qualifier on the command line 2 DECTPU reads the specified or default command file if found into a buffer named LOCAL INI unless you ...

Page 119: ...e command file if there is one For more information on DECTPU s initialization sequence see Section 5 6 4 Place any statements that implement or handle initialization files in a procedure named TPU INIT_POSTPROCEDURE DECTPU executes this procedure after both the TPU INIT_PROCEDURE and the command file have been executed This enables commands or definitions in the initialization file to modify comm...

Page 120: ...a non EVE section file you must determine whether that section file has implemented the convention of including a TPU LOCAL_INIT procedure After adding DECTPU procedures and statements that implement your application end your program with the following statements A statement that contains the SAVE built in procedure SAVE is the mechanism by which you store all currently defined procedures variable...

Page 121: ...indow in which to enter DECTPU programs or text A prompt area in which to enter DECTPU commands Because DECTPU does not have any keys defined when invoked without a section file the sample program also contains the following key definitions Return key Delete key Key for exiting from DECTPU Key for entering DECTPU statements Example 5 5 uses the Tab key By default DECTPU looks for TPU INIT_PROCEDUR...

Page 122: ...in buffer POSITION main_buffer tpu local_init ENDPROCEDURE PROCEDURE tpu local_init Procedure to allow end users to add private extensions ENDPROCEDURE Define the minimal editing keys DEFINE_KEY SPLIT_LINE RET_KEY DEFINE_KEY ERASE_CHARACTER 1 DEL_KEY DEFINE_KEY EXECUTE READ_LINE DECTPU Statement TAB_KEY DEFINE_KEY EXIT Ctrl_Z_KEY Create a section file and then quit IF get_info system operating_sys...

Page 123: ...uture sessions enter the following statement at the Command prompt Command SAVE sys login mini If you want to save the DECTPU source code for the key definitions write out the current buffer or use the EXIT built in procedure to leave the DECTPU session so that the contents of the buffer are written to a file 5 6 5 4 Recommended Conventions for Section Files A section file that implements a layere...

Page 124: ...ication Recommended Name Synonym Provided for Backward Compatibility Data Type Structure How DECTPU Uses the Variable TPU X_MESSAGE_ BUFFER MESSAGE_BUFFER Buffer DECTPU writes messages in this buffer If the MESSAGE_BUFFER is associated with a window that is mapped to the screen DECTPU updates the window If the application does not assign a buffer to this variable DECTPU writes messages to the scre...

Page 125: ...attern MATCH text_marker_range SEARCH_QUIETLY text_marker_pattern GET_INFO CURRENT_BUFFER direction IF text_marker_range 0 THEN POSITION text_marker_range ELSE MESSAGE Text_marker not found ENDIF RETURN text_marker_range ENDPROCEDURE If you name the file that contains this procedure TEXT_MARKERS TPU you can invoke DECTPU with EVE and your command file with the following command EDIT TPU COMMAND de...

Page 126: ...e of the initialization file as a qualifier to the EDIT TPU command Define a logical name EVE INIT to point to your initialization file The first and third methods are appropriate if you intend to use one initialization file most of the time to customize your editing sessions If you name the file EVE INIT EVE and do not specify another EVE initialization file on the command line EVE automatically ...

Page 127: ...TS buffer use the EVE command SHOW DEFAULTS BUFFER For example if you want to know what the tab settings are for the DEFAULTS buffer type the following command Command SHOW DEFAULTS BUFFER This command causes EVE to show buffer information in a format similar to the format in Example 5 7 using values that apply to your editing session Example 5 7 SHOW DEFAULTS BUFFER Display EVE V3 1 1993 08 17 08...

Page 128: ... You can invoke the DECTPU debugger to debug one of the following kinds of files Section files Command files Files that contain DECTPU programs that are not startup programs The following sections contain more information on debugging each kind of file 5 7 2 1 Debugging Section Files To invoke the debugger for a section file specify the following command on your command line EDIT TPU DEBUG Use of ...

Page 129: ...7 2 3 Debugging Other DECTPU Source Code To debug a DECTPU program that is not a section file or a command file use the DEBUG qualifier when you invoke DECTPU For example to debug procedures in a file called USER_APPLICATION TPU invoke the debugger on the command line as follows EDIT TPU DEBUG USER_APPLICATION TPU The debugger creates a window that fills the screen as described in Section 5 7 2 1 ...

Page 130: ... source buffer remain there so that the time DECTPU takes to find a procedure may increase as more files are read into the source buffer You cannot use the TPU command followed by the MESSAGE built in procedure to examine the contents of a local variable while debugging To use the MESSAGE built in to examine a local variable you must write the MESSAGE built in into the procedure you are debugging ...

Page 131: ...ting from DECTPU 4 DCL command procedure to run DECTPU from a subprocess A 1 Line Mode Editor Example A 1 shows a portion of an editing interface that uses line mode rather than screen displays for editing tasks You can use this mode of editing for batch jobs or for running DECTPU on terminals that do not support screen oriented editing Example A 1 Line Mode Editing Portion of a line mode editor f...

Page 132: ...s how to display control characters in a meaningful way This is accomplished by translating the buffer to a different visual format and mapping this new form to a window On the VT400 VT300 and VT200 series of terminals control characters are shown as reverse question marks on the VT100 series of terminals they are shown as rectangles Example A 2 Procedure to Display Control Characters This procedu...

Page 133: ...te_array 21 NAK translate_array 22 SYN translate_array 23 ETB translate_array 24 CAN translate_array 25 EM translate_array 26 SUB translate_array 27 ESC translate_array 28 FS translate_array 29 GS translate_array 30 RS translate_array 31 US ENDIF The range must be a single character long IF LENGTH char_range 1 THEN RETURN 0 ENDIF Find the character replace_text translate_array ASCII STR char_range...

Page 134: ...6 ASCII 27 ASCII 28 ASCII 29 ASCII 30 ASCII 31 LOCAL Ctrl_char_pattern Ctrl_char_range Create the translation buffer and window if necessary IF translate_buffer TPU K_UNSPECIFIED THEN translate_buffer CREATE_BUFFER translation SET NO_WRITE translate_buffer ENDIF IF translate_window TPU K_UNSPECIFIED THEN translate_window CREATE_WINDOW 1 10 ON ENDIF Make a copy of the buffer we are translating ERAS...

Page 135: ...Y Ctrl_char_pattern FORWARD EXITIF Ctrl_char_range 0 POSITION Ctrl_char_range If we did not translate the character move past it IF NOT translate_controls Ctrl_char_range THEN MOVE_HORIZONTAL 1 ENDIF ENDLOOP Now display what we have done POSITION BEGINNING_OF translate_buffer MAP translate_window translate_buffer ENDPROCEDURE Sample DECTPU Procedures A 5 ...

Page 136: ...widths are the same the physical screen width is changed Example A 3 Procedure to Restore Screen to Original Width PROCEDURE user_restore_screen LOCAL original_screen_width temp_w original_screen_width GET_INFO SCREEN original_width IF original_screen_width GET_INFO SCREEN width THEN temp_w get_info windows first LOOP EXITIF temp_w 0 SET WIDTH temp_w original_screen_width temp_w GET_INFO WINDOWS n...

Page 137: ...ck to the parent tt f getdvi sys command devnam _ _ edit_name Edit_ tt priv_list f setprv NOWORLD NOGROUP pid 0 10 proc f getjpi f pid pid PRCNAM if proc eqs edit_name then goto attach if pid ne 0 then goto 10 spawn priv_list f setprv priv_list write sys error Spawning a new Kept Editor define nolog sys input sys command t1 f edit p1 p2 p3 p4 p5 p6 p7 p8 COLLAPSE spawn process edit_name nolog edit...

Page 138: ......

Page 139: ... Compaq VT52 compatible terminals Optimum DECTPU performance is achieved on the VT300 series VT200 series and VT100 series terminals Some of the high performance characteristics of DECTPU may not be apparent on the terminals listed in Table B 1 for the reasons stated Table B 1 Terminal Behavior That Affects DECTPU s Performance Terminal Characteristic VT102 Slow autorepeat rate VT240 Slow autorepe...

Page 140: ...t receives these control sequences you must turn off the DEC_CRT mode bit Some foreign terminals may not be fully compatible with DECTPU and may exhibit this behavior Edit Mode Terminals that are operating in edit mode allow the editor to take advantage of special edit mode control sequences during deletion and insertion of text for optimization purposes Some current Compaq terminals that support ...

Page 141: ... B 2 Using Line Mode Editing on Unsupported Terminals If you want to run DECTPU from an unsupported terminal you must inform DECTPU that you do not want to use screen capabilities To invoke DECTPU on an unsupported terminal use the NODISPLAY qualifier after the EDIT TPU command See Chapter 2 for more information on this qualifier While in no display mode DECTPU uses the RTL generic LIB PUT_OUTPUT ...

Page 142: ...rminal Support B 3 Using Terminal Wrap Example B 1 DCL Command Procedure for SET TERM NOWRAP SET TERM NOWRAP ASSIGN USER SYS COMMAND SYS INPUT EDIT TPU SECTION EDTSECINI SET TERM WRAP B 4 DECTPU Terminal Support ...

Page 143: ... that procedure Local constants cannot be examined GO Causes the debugger to relinquish control of execution until it is invoked again by a breakpoint by the DEBUG command or by the DEBUGON procedure HELP Lists available debugger commands and keypad bindings QUIT Stops execution of the current procedure Uses the ABORT statement to return to the main loop of DECTPU This command is useful when you h...

Page 144: ...ft you press the key sequence GOLD Left Arrow then enter the number of columns to move To move right you press the key sequence GOLD Right Arrow then enter the number of columns to move SHOW BREAKPOINTS List the current breakpoints in the debugger source window To redisplay code in the source window use the DISPLAY SOURCE command SPAWN subprocess Suspends the current editing session and creates a ...

Page 145: ... of 5 8 Callbacks 5 7 to 5 9 handling in EVE 5 10 CASE statement 4 21 to 4 22 Case style error handler 4 25 to 4 28 Character set 4 1 Character_cell display 2 12 CHARACTER_SET qualifier 2 9 Closures 5 10 Command files 5 24 to 5 25 debugging 5 29 default 5 17 definition 2 2 sample 5 25 Command line JOURNAL qualifier 2 6 NOJOURNAL qualifier 2 6 RECOVER qualifier 2 6 Command parameter See EDIT TPU co...

Page 146: ...and C 1 section files 5 28 SET BREAKPOINT command 5 28 C 1 SET WINDOW command C 2 SHIFT command C 2 SHOW BREAKPOINTS command C 2 source code 5 29 SPAWN command C 2 Debugging cont d STEP command 5 30 C 2 to examine contents of local variable 5 30 TPU command C 2 DEBUGON procedure 5 29 DEBUG qualifier 2 12 5 28 DECTPU DECwindows 1 2 journaling methods 2 6 relationship with DECwindows features 1 3 ru...

Page 147: ...le default name for journaling 2 8 File specifications default file specifications 2 2 Found range selection in EVE 5 14 Free marker 3 8 to 3 10 Function procedures 4 18 G Gadget 3 22 GET_INFO built in procedure string constant parameter journaling 2 6 2 14 journal_file 2 7 2 14 WIDGET keyword parameter callback_parameters 5 10 Global selection support for 5 6 to 5 7 Global variable 4 5 I Identifi...

Page 148: ...2 19 Logical operators AND operator 4 8 NOT operator 4 8 OR operator 4 8 XOR operator 4 8 LOOP statement 4 20 M MARK data type 3 8 to 3 10 Marker deleting 3 10 padding effects 3 9 to 3 10 video attributes 3 8 Memory error resulting from exceeding 2 8 Message buffer 5 15 MESSAGE_BUFFER variable 5 24 MODIFY qualifier 2 15 Module declaration syntax 4 14 MODULE statement 4 14 N Names for procedures 4 ...

Page 149: ...e 4 18 Relational expression 4 10 Relational operators 3 15 Removal of window 3 25 Repetitive statements 4 20 Reserved word built in procedures 4 12 keywords 4 12 language elements 4 13 to 4 14 predefined constants 4 12 Resource supported data types for 5 11 Restoring terminal width example A 6 Restrictions for DECTPU virtual address space 2 8 for subprocesses on OpenVMS systems 3 18 RETURN statem...

Page 150: ...5 22 TPU STACKOVER status correcting 5 2 TPU WIDGET_INTEGER_CALLBACK callback routine 5 8 5 9 TPU WIDGET_STRING_CALLBACK callback routine 5 8 5 9 TPU X_MESSAGE_BUFFER variable 5 24 TPU X_SHOW_BUFFER variable 5 24 TPU X_SHOW_WINDOW variable 5 24 TPU _UNKLEXICAL error message 4 34 TPU command 5 15 TPU debugger 5 28 to C 2 ATTACH command C 1 CANCEL BREAKPOINT command C 1 DEBUGON procedure 5 29 DEPOSI...

Page 151: ...5 11 specifying 5 10 Window creating 3 23 current 3 24 definition 3 22 dimensions 3 23 getting information 3 25 length 3 23 mapping 3 24 removing 3 25 unmapping 3 25 unsupported terminals 3 26 updating 3 25 values 3 24 width 3 23 WINDOW data type 3 22 to 3 26 X XOR operator 4 8 Index 7 ...

Page 152: ......

Reviews: