Compaq AA-PWCBD-TE Computer Accessories User Manual


 
DEC Text Processing Utility Program Development
5.1 Creating DECTPU Programs
Other possible reasons for a TPU$_STACKOVER condition are that you have too
many statements that are not in procedures, or that you have too many small
procedures. If you have too many small procedures, you must either consolidate
them or break them into separate files.
To see an example of a complex DECTPU program, examine the source
files that implement EVE. The EVE source code files are located at
SYS$EXAMPLES:EVE$*.*. These files contain many procedure declarations
and executable statements that specify EVE’s screen layout and display. These
files also contain key definitions that specify which editing operations are
performed when you press certain keys on the keyboard. You can examine these
files to learn the programming techniques that 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 each executable statement from other statements. In a program, you
must place all procedure declarations before any executable statements that are
not part of a procedure declaration. For information on DECTPU data types,
see Chapter 3. For information on DECTPU language elements, see Chapter 4.
Example 5–2 shows the correct syntax for a DECTPU program.
Example 5–2 Syntax of a DECTPU Program
PROCEDURE
.
.
.
ENDPROCEDURE
PROCEDURE;
.
.
.
ENDPROCEDURE;
.
.
.
PROCEDURE
.
.
.
ENDPROCEDURE;
statement 1;
statement 2;
.
.
.
statement n;
A variety of syntactically correct DECTPU programs is shown in Example 5–3.
DEC Text Processing Utility Program Development 5–3