Guardian Programmer's Guide

Table Of Contents
Creating and Managing Processes
Guardian Programmer’s Guide 421922-014
16 - 43
Sending and Receiving the Startup Message
! Send the new process the Startup message. The receiving
! process reply with file-system error ZFIL^ERR^CONTINUE
! indicating that it is ready to receive Assign messages.
CALL WRITEX(F^NUM,CI^STARTUP,MESSAGE^LEN);
IF <> THEN
BEGIN
CALL FILE_GETINFO_(F^NUM,ERROR);
IF ERROR <> ZFIL^ERR^CONTINUE THEN CALL PROCESS_STOP_;
END;
! There are no Assign messages so close the new process:
CALL FILE_CLOSE_(F^NUM);
END;
The new process receives the Startup message the same way as any process receives
a Startup message from the TACL process. The process simply opens its $RECEIVE
file and reads the message. The recommended way to do this is by calling the
INITIALIZER procedure.
?INSPECT, SYMBOLS, NOCODE, NOMAP
?NOLIST, SOURCE $SYSTEM.ZSYSDEFS.ZSYSTAL
?LIST
!Global parameters
LITERAL MAXLEN =
ZSYS^VAL^LEN^FILENAME; !Maximum file-name length
INT OUTNUM; !OUT file number
INT INNUM; !IN file number
STRING .S^PTR; !pointer to end of string
STRUCT .CI^STARTUP; !Startup message
BEGIN
INT MSGCODE;
STRUCT DEFAULTS;
BEGIN
INT VOLUME[0:3];
INT SUBVOL[0:3];
END;
STRUCT INFILE;
BEGIN
INT VOLUME[0:3];
INT SUBVOL[0:3];
INT FILEID[0:3];
END;
STRUCT OUTFILE;
BEGIN
INT VOLUME[0:3];
INT SUBVOL[0:3];
INT FILEID[0:3];
END;
STRING PARAM[0:529];
END;
INT MESSAGE^LEN;