Guardian Programmer's Guide

Table Of Contents
Communicating With a TACL Process
Guardian Programmer’s Guide 421922-014
8 - 14
Processing the Param Message
Processing the Param Message
This example requests, reads, and processes a Param message. Here, the process
expects only one PARAM named P1. Again two user procedures perform the
processing as follows:
1. The main procedure calls INITIALIZER and supplies it with the name of the
procedure that processes Param messages.
2. The INITIALIZER procedure reads the Startup message and any Assign
messages.
3. The INITIALIZER procedure reads the Param message and calls the PARAMS
procedure.
4. The PARAMS procedure scans the Param message looking for the parameter
name P1. When it finds the P1 parameter, it returns the parameter value to a
global variable along with the parameter length.
Note that if you wanted to retrieve more parameter values from the Param
message, you would start the scan again for each additional parameter.
? INSPECT, SYMBOLS
!Global variables:
STRING .PARAM1[0:255]; !parameter value
INT PARAM1^LEN; !parameter length
INT PARAM1^PRESENT; != 1 if P1 present, 0 if not
! present
? NOLIST, SOURCE $SYSTEM.SYSTEM.EXTDECS(INITIALIZER)
? LIST
PROC PARAMS(RUCB,
PARAM^DATA,
MESSAGE,
LENGTH,
MATCH) VARIABLE;
INT .RUCB,
.PARAM^DATA,
.MESSAGE,
LENGTH,
MATCH;
BEGIN
INT NUMPAR, I; !number of parameters in Param message
STRING .PTR; !pointer to Param message
! Get the number of parameters in the message:
NUMPAR := MESSAGE[1];