Guardian Programmer's Guide

Table Of Contents
Communicating With a TACL Process
Guardian Programmer’s Guide 421922-014
8 - 12
Using INITIALIZER to Read Assign and
Param Messages
Using INITIALIZER to Read Assign and Param Messages
To request the TACL process to send all Assign and Param messages, your process
can again use the INITIALIZER procedure. In addition to reading the Startup message,
the INITIALIZER procedure reads the Assign and Param messages if bit 0 of the
flags parameter is set to zero (the default setting). As with the Startup message, you
can process the Assign or Param messages by supplying the name of a message-
processing procedure as a parameter in the call to INITIALIZER.
The following example reads the Startup message, requests and reads the Assign and
Param messages, and calls user-supplied procedures to process each of these
messages:
CALL INITIALIZER(!rucb!,
!passthru!,
START^PROC,
PARAMS,
ASSIGN^NAME);
The START^PROC procedure processes the Startup message. The PARAMS
procedure processes the Param message, and the ASSIGN^NAME procedure
processes Assign messages.
Processing Assign Messages
The following example requests, reads, and processes Assign messages. Here, the
process is expecting two assignments: one for the variable SERVER1 and one for the
variable SERVER2. A real program will usually also save the Startup message, if only
to apply the default values to the file names from the Assign messages.
This example includes two user-written procedures whose combined actions are
summarized as follows:
1. The main procedure calls the INITIALIZER procedure, passing it the name of the
procedure that will process the Assign messages.
2. The INITIALIZER procedure reads the Startup message and any Assign or Param
messages.
3. The INITIALIZER procedure calls the ASSIGN^NAME procedure for each Assign
message received.
4. The ASSIGN^NAME procedure checks the Assign message for a logical file name
of SERVER1 or SERVER2. If the logical file name is SERVER1, then the actual
file name supplied in the message is equated with the logical name SERVER1. If
the logical file name is SERVER2, then the actual file name is equated with
SERVER2.
5. Once all Assign messages have been processed, the INITIALIZER procedure
reads the Param message. Because no procedure is specified for processing the
Param message, its contents are ignored.