beautypg.com

1 compiling on the eve command line, 2 compiling in a dectpu buffer, 5 executing dectpu programs – Compaq DEC Text Processing Utility AA-PWCBD-TE User Manual

Page 115

background image

DEC Text Processing Utility Program Development

5.4 Compiling DECTPU Programs

To see DECTPU messages while in EVE, use the BUFFER MESSAGES
command. To return to the original buffer or another buffer of your choice,
use the BUFFER name_of_buffer command.

There are two ways to compile a program in DECTPU: on the command line of
EVE or in a DECTPU buffer.

5.4.1 Compiling on the EVE Command Line

You can compile a simple DECTPU program by entering it on the EVE command
line. For example, if you use the TPU command and then enter the SHOW
(SUMMARY) statement, DECTPU compiles and executes the program associated
with the SHOW (SUMMARY) statement.

5.4.2 Compiling in a DECTPU Buffer

DECTPU programs are usually compiled by entering DECTPU procedures and
statements in a buffer and then compiling the buffer. If you are using EVE,
you can enter the SHOW (VARIABLES) command in a buffer and compile the
buffer by using the TPU command and entering the following statement after the
prompt:

TPU Statement: COMPILE (CURRENT_BUFFER);

The program associated with SHOW (VARIABLES) is not executed until you
enter the following statement:

TPU Statement: EXECUTE (CURRENT_BUFFER);

If you use a buffer, a range, or 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 to a variable. The following example shows
how to make this assignment:

new_program := COMPILE (CURRENT_BUFFER);

If no error messages are issued while you compile the current buffer, you can
then execute the program new_program with the following statement:

EXECUTE (new_program);

You can use the COMPILE built-in procedure to compile certain parts of a buffer
rather than a whole buffer. To do so, create a range that includes the statements
within the buffer that you want compiled, and then specify the range as the
parameter for COMPILE.

5.5 Executing DECTPU Programs

You can use programs that are already compiled as parameters for the EXECUTE
built-in procedure. In addition, you can use buffers, ranges, or strings that
contain executable DECTPU statements as parameters for the EXECUTE built-in
procedure. DECTPU compiles the contents of the buffer, range, or string if
necessary; then DECTPU executes the compiled buffer, range, or string.

DEC Text Processing Utility Program Development 5–15