Compaq AA-PWCBD-TE Computer Accessories User Manual


 
DEC Text Processing Utility Program Development
5.5 Executing DECTPU Programs
After using the TPU command, suppose you used the following statement to
create a program called new_program:
TPU Statement: new_program := COMPILE (CURRENT_BUFFER);
You could then execute new_program by using the following statement after using
the TPU command:
TPU Statement: EXECUTE (new_program);
You could also compile and execute the statements in the current buffer by using
the following TPU statement after using the TPU command:
TPU Statement: EXECUTE (CURRENT_BUFFER);
You can enter, compile, and execute small DECTPU programs on the EVE
command line. The following example shows a small program that you can enter
after the TPU Statement: prompt.
TPU Statement: SET (TIMER, ON, "Executing");
The preceding command executes the program associated with the SET (TIMER)
built-in procedure and causes the string "Executing" to be displayed at 1-second
intervals when a long procedure is executing. The string is displayed in the last
15 spaces of the prompt area at 1-second 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 another procedure.
5.5.2 Process Suspension
To suspend a process, you can use Ctrl/C.
Pressing Ctrl/C causes DECTPU to stop the execution of a user-written program.
You can also stop the execution of the following DECTPU built-in procedures with
Ctrl/C:
LEARN_BEGIN . . . LEARN_END (execution of a learn sequence)
READ_FILE
SEARCH
WRITE_FILE
Caution
Because DECTPU does not journal Ctrl/C, using Ctrl/C may affect the
accuracy of your keystroke journal file. In addition, Ctrl/C prevents
completion of some built-in procedures, such as ERASE_RANGE, MOVE_
TEXT, and FILL. DECTPU behavior after such an interruption is
unpredictable. Compaq recommends that you exit from the editor after
pressing Ctrl/C to ensure that you do not lose any work because of an
inaccurate keystroke journal file.
5–16 DEC Text Processing Utility Program Development