Writing tacl macros, Using a library file – HP NonStop G-Series User Manual

Page 85

Advertising
background image

Defining Function Keys and Writing Macros

Guardian User’s Guide 425266-001

5 -9

Writing TACL Macros

Writing TACL Macros

You can write and store TACL macros using:

A library file, which can contain many macro definitions. Use library files to store
macros and aliases for TACL commands that you regularly use.

To invoke the macro, enter its name at the TACL prompt. The file must be loaded
into memory.

A file that begins with a ?TACL directive, which can contain only one macro
definitiony. These files are more appropriate for programmers performing a series of
related TACL commands and built-in functions.

To invoke the macro, enter the name of the file that contains the macro definition.
The directive’s file is not loaded into memory. For more information about these
files, see the TACL Programming Guide.

Using a Library File

Creating and loading a general-purpose library file that contains macro definitions is
similar to creating and loading a macro that defines your function keys. However, to
invoke the macro, you enter the macro name at the TACL prompt instead of pressing a
function key.

A library file is an EDIT file (file code 101). Create this file in your saved default
subvolume, using a text editor such as TEDIT. Give the file a descriptive name such as
MYMACS. For each macro you want to define, enter:

macro-name

Name of the macro you are defining.

macro-type

ALIAS or MACRO. For other types, see the TACL Reference Manual.

command

TACL command that you want this macro to execute.

In the first example, the letter P is used as an alias for PERUSE. In the second example,
the letters FN invoke the FILENAMES command with one dummy argument.

?SECTION P ALIAS
PERUSE

?SECTION FN MACRO
FILENAMES %*%

?SECTION macro-name macro-type
command

[ command ]...

Advertising
This manual is related to the following products: