Guardian Programmer's Guide

Table Of Contents
Using DEFINEs
Guardian Programmer’s Guide 421922-014
7 - 10
Working With DEFINEs
The CLASS attribute determines what other attributes are associated with the DEFINE.
The CLASS attribute has a data type of keyword. When assigning values to DEFINE
attributes, you must assign one of these values to the CLASS attribute first. Assigning
a value to the CLASS attribute causes default values to be assigned to other attributes
in that DEFINE CLASS.
The attributes of a particular DEFINE are distinct from attributes of the other DEFINE
classes, even when the attributes have the same names.
Working With DEFINEs
The most common use of DEFINEs is to pass information from a parent process to its
child processes. For processes that are created by TACL, you can create DEFINEs
using SET DEFINE commands and ADD DEFINE commands; see the Guardian
User’s Guide. Other processes can pass DEFINEs received from their creators down
to their child processes, or they can add DEFINEs using procedure calls such as
DEFINESETATTR and DEFINEADD; see Adding DEFINEs later in this section.
See Section 16, Creating and Managing Processes, for further information about
propagating DEFINEs, including how to prevent DEFINEs from propagating.
As the recipient of DEFINE information, all you need to do is:
1. Make sure that DEFINE mode is turned on.
2. Refer to the DEFINE by name to make use of the attributes specified in the
DEFINE.
Enabling DEFINEs
Every process has an attribute called DEFINE mode. DEFINE mode controls whether
DEFINEs can be used or created. The DEFINE mode of a process can be on or off.
When DEFINE mode is off, the DEFINEs that exist in the context of the process
are ignored. When your process starts another process, the DEFINEs in the
context of your current process are not propagated to the new process unless you
specify otherwise in a parameter to the PROCESS_CREATE_ procedure (see
Section 16, Creating and Managing Processes, for details of propagating DEFINEs
to other processes). The one exception to this rule is the =_DEFAULTS DEFINE,
which is always propagated to the child process.
You cannot add or replace DEFINEs in the context of the current process when
DEFINE mode is off.
When DEFINE mode is on, processes use the DEFINEs that exist in the context of
the current process. When your process starts another process, the DEFINEs in
the context of the current process are propagated to the new process. You can
add or replace DEFINEs in the context of the current process when DEFINE mode
is on.