User guide

Using ENFORM in Interactive Mode
Compiling and Executing a Query
058058 Tandem Computers Incorporated 4–7
If you frequently use the same statements and commands, place them in an Edit file
and use the ?SOURCE command to read them into your ENFORM programs. For
example:
:ENFORM
ENFORM - T9102C08 - (01DEC81) DATE - TIME: 5/26/82 - 13:52:45
>?EDIT test5
TEXT EDITOR - T9601C08 - (01APR82)
CURRENT FILE IS $DATA.TEST.TEST5
*ADD 3
1 ?SOURCE addfile
2 OPEN parts;
3 LIST parts;
*EXIT
>?RUN
If you use the ?SOURCE command to read an Edit file containing a LIST or FIND
statement, ENFORM compiles and executes the associated query as soon as the LIST
or FIND statement is encountered.
Use the ?COMPILE command to compile a source program without executing it. The
?COMPILE command compiles the source code and saves the compiled query in a
physical file. The ?COMPILE command compiles source code containing either LIST
or FIND statements; however, only one LIST or FIND statement can be compiled in a
source program. If more than one LIST or FIND statement exists in a source program,
ENFORM compiles up to the first statement encountered and then executes any
subsequent statements. You should compile source programs that: are called from a
host language program, are passed parameters, or that you want to protect from
inadvertent changes. In the following example the source program is created on
report1 and compiled and saved on the compiled query file comprpt:
:ENFORM
ENFORM - T9102C09 - (02APR82) DATE - TIME: 5/26/82 - 13:59:05
>?EDIT report1
TEXT EDITOR - T9601C08 - (01APR82)
CURRENT FILE IS $DATA.TEST.REPORT1
* ...
*EXIT
>?COMPILE report1 TO comprpt