Nesting Tacl Code - HP TACL Programming Manual

Tandem advanced command language
Table of Contents

Advertisement

To run another TACL program from within a TACL program, invoke the file name or

Nesting TACL Code

variable name, as appropriate.
Certain built-in functions can be used only within one type of program (macro or
routine). To determine the use of such functions in a nested program, see individual
function descriptions in the TACL Reference Manual. For example, #ARGUMENT must
be used within a routine, but can be used in a macro if the macro is nested within a
routine.
To call a program recursively, use %0% (for a macro) or #ROUTINENAME (for a
routine) to specify the name of the program. You cannot call a text variable
recursively.
The following macro calls itself to display each of its arguments on a separate line:
?TACL MACRO
#OUTPUT %1%
[#IF NOT [#EMPTY %2%] |THEN|
]
To run this macro, type the file name from the TACL prompt and supply one or more
arguments. The macro displays the arguments you supply. In the following example,
the file name that contains the macro is called ARGS:
12> args a b c d
a
b
c
d
13>
Section 3, "Developing TACL Routines," contains a macro that calls a nested routine.
107365 Tandem Computers Incorporated
== Test for additional arguments
%0% %2 TO *%
== Display current argument
== Call self without current
== argument.
Developing TACL Programs
Defining Program Structure
2–7

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents