Guardian Programmer's Guide

Table Of Contents
Communicating With a TACL Process
Guardian Programmer’s Guide 421922-014
8 - 6
Using INITIALIZER to Read the Startup Message
Using INITIALIZER to Read the Startup Message
It is up to the application to choose what to do with the information contained in the
Startup message. To use the startup information, your program must first read the
Startup message from its $RECEIVE file. The INITIALIZER procedure provides a
convenient way to do this.
In its simplest form, INITIALIZER reads the Startup message but does not process it:
CALL INITIALIZER;
The benefit of doing this is to prevent unwanted run-time messages indicating that the
Startup message was not read.
If you want to read the Startup message and then process it, you need to specify a
user-supplied procedure to do the processing. Call INITIALIZER as follows:
CALL INITIALIZER(!rucb!,
!return^data!,
START^PROC);
Here, START^PROC is a user-supplied procedure that processes the Startup
message. The INITIALIZER procedure passes the message to the user-supplied
procedure. Typically, the user-supplied procedure saves the Startup message in global
data and returns. However, it can alternatively use the RETURN^DATA variable to
return data from the user-supplied procedure back to the procedure that called
INITIALIZER.
The user-supplied procedure must be declared with parameters that match exactly
those expected by the INITIALIZER procedure. See below for an example, or refer to
the Guardian Procedure Calls Reference Manual for a complete description of the
required parameters.
Processing the Startup Message
The example given below is made up of a main procedure that reads the Startup
message and another procedure that processes it. Their combined actions are
summarized as follows:
1. The main procedure calls the INITIALIZER procedure, giving it the name of a
procedure to process the Startup message and an array to receive the response.
2. The INITIALIZER procedure passes the Startup message and message length to
the START^IT procedure. The message is passed in the MESSAGE parameter,
and the message length is passed in the LENGTH parameter.
3. The START^IT procedure saves the Startup message in global data.
4. The START^IT procedure terminates, returning control to the INITIALIZER
procedure.
5. The INITIALIZER procedure returns control to the main procedure.