A TAE internal proc is a process, procedure or parameter set (PARMSET)
definition nested within another proc definition. It provides a way for
short, related procs, such as ones declaring parameter qualifiers, to be
contained within a single PDF.
The rules governing internal procs are the following:
- An internal proc is invoked exactly the same as an external proc is
invoked, that is, by specifying the proc on a TCL command line. Note,
however, that the TCL command line that invokes the internal proc must
be in the body of the procedure that surrounds the internal proc. The
body of the following procedure, for example, invokes the internal proc,
INTPROC:
PROCEDURE
PROCEDURE NAME=INTPROC !internal proc
PARM P1
BODY
WRITE &P1
END-PROC
BODY
INTPROC hello !invoke INTPROC
END-PROC
- With regard to the proc hierarchy search, internal procs are
searched for after TCL intrinsic commands, and before the user library.
- Internal procs must start with the PROCEDURE, PROCESS, or PARMSET
statement, using the NAME parameter for identification. The HELP value
for the internal proc, if specified, is ignored.
- An internal proc is defined entirely within the declaration or body
section of the outer proc.
- The help information for the parameters should be placed with the
main proc's help text.
- An internal proc must be declared before it is invoked or
referenced. An internal proc may not be invoked with RUNTYPE=ASYNC,
RUNTYPE=ASYNC-PROCESS or RUNTYPE=BATCH.
- A process initiated using an internal proc may not request dynamic
parameters.
- An internal proc may access variables declared within itself or in
an outer proc. The definition of a variable is first searched for in the
internal proc and if not found, the search moves to the outer proc. The
search continues on through the layers of outer procs ending with the
outermost proc.
- Variables may only be deleted within the internal proc that defines
the variable.
- Processes that are declared as internal procs receive all referenced
globals, all locals, and parameters that are declared in enclosing
procs. The declaration of global references using the REFGBL command is
also acceptable in internal procs.
A convenient use of internal procs is to provide qualifiers for a
parameter. In the following example, the internal proc QUALSET provides
qualifiers to parameter IMAGE:
! Typical Invocation:
! ENHANCE image=bigimage |line=200,band=3|
!
PROCESS !in ENHANCE.PDF
PARMSET NAME=QUALSET
parm line integer valid=1:3000
parm band integer valid=1:8
END-PROC
parm image quals=qualset
END-PROC