DEC Text Processing Utility Program Development
5.6 Using DECTPU Startup Files
Whenever you want to add new procedures, variables, learn sequences, or key
definitions to a section file, edit the command file to include the new items, and
then recompile the command file to produce a section file with the new items. For
example, if you want to add key definitions for the arrow keys, you could edit the
file MINI.TPU and add the following statements after any procedures in the file:
DEFINE_KEY ("MOVE_VERTICAL (-1)", UP);
DEFINE_KEY ("MOVE_VERTICAL (1)", DOWN);
DEFINE_KEY ("MOVE_HORIZONTAL (1)", RIGHT);
DEFINE_KEY ("MOVE_HORIZONTAL (-1)", LEFT);
Recompile the command file with the following command:
$EDIT/TPU/NOSECTION/COMMAND=MINI.TPU
After you have completed the previous steps, you can use the section file you
created to invoke DECTPU with the new key definitions included.
An alternate way of adding these key definitions to your section file is to enter
the definitions as text in the current buffer. You could then press the Tab key (the
command prompt key for the minimal interface) and enter the following command
after the prompt:
TPU Statement: EXECUTE (CURRENT_BUFFER);
This causes the new key definitions to be added to your current editing context.
To add the definitions to the section file so you can use them in future 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 layered application should include the following
procedures:
• TPU$INIT_PROCEDURE
• TPU$LOCAL_INIT
If your application is to support initialization files, the section file that
implements the application should also include a procedure called TPU$INIT_
POSTPROCEDURE. This procedure should contain the DECTPU statements that
implement or handle the initialization files.
For information on EVE’s implementation of initialization files, see Section 5.6.7.
The TPU$INIT_PROCEDURE procedure should perform the following operations:
Initialize all global variables to their startup values
Create all required work spaces for the editor (see the list of special purpose
buffers and windows in Table 5–2)
You can add other functions to TPU$INIT_PROCEDURE, but it should perform
at least these two operations.
If your application allows the end user to customize the application by using a
command file, you may want to make available to the user a procedure called
TPU$LOCAL_INIT. (Although this name is not required, it is commonly used by
DECTPU programmers.)
DEC Text Processing Utility Program Development 5–23