TACL Reference Manual
Statements and Programs
HP NonStop TACL Reference Manual—429513-018
5-12
Creating Program Files
•
Very large macros or routines. As a rule, macros should never exceed 15,000
bytes after dummy argument substitution; routines should never exceed 15,000
bytes. Nesting reduces these numbers further.
•
Uncontrolled nesting of macros. (If, however, you construct a recursive macro so
that it invokes itself in its last statement, each instance of the macro vanishes from
the text buffer before the next one begins and does not increase the contents of
the text buffer.)
•
Matching too many file names with the #FILENAMES function. TACL stores the
information in the text buffer before displaying it. Loading too much data (such as
large subvolumes of file names).
•
Using #CHARxxx, #LINExxx, or #DELTA built-in functions on data larger than
15,000 bytes.
Creating Program Files
You can store TACL programs in one of three ways:
•
One program in an edit file, executed by referencing the file name. The first line
must be a ?TACL directive.
•
Several programs in a single edit file, known as a library file, executed by loading
the file into variables and then referencing the name of the variable (defined in the
code). A library file can also contain other types of variables. Each variable starts
with a ?SECTION directive that assigns a name to the variable.
•
One or more programs in a segment file, executed by attaching the file (making
them accessible to TACL) and then referencing the variable name associated with
the program.
You can set up your TACL environment so that it loads variables from edit files or
segment files automatically at logon time.
Creating a Single-Variable Program File: The ?TACL
Directive
To store a single variable in a file, create an edit-format file whose first line is a ?TACL
MACRO or ?TACL ROUTINE directive. To invoke the text, macro, or routine, type the
file name.
The name of the subvolume containing the program file must be in #PMSEARCHLIST,
or you must qualify it fully, to enable TACL to find it and invoke the file.
When you invoke a ?TACL ROUTINE file, TACL automatically pushes a variable called
:_TACL_ROUTINE and reads the file into it; TACL pops :_TACL_ROUTINE when the
routine exits. Thus, :_TACL_ROUTINE becomes the name of the active routine.
This feature is useful for recursion: a routine stored in a ?TACL ROUTINE file cannot
determine the name of the file it is stored in, but the #ROUTINENAME built-in function,