Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 54
Reading System Messages
If the bit is set to 1, then your process receives the corresponding system message. If
the bit is 0, then your process does not receive the message.
The following example accepts only messages that indicate an attempted open or
close of the current process. Bit 14 in the second word of the mask corresponds to the
Open message. The example shows both the native and TNS forms of the SET^FILE
call.
MASK[0] := %B0010000000000000;
MASK[1] := %B0000000000000011;
MASK[2] := 0;
MASK[3] := %B0000101000000000;
?IF PTAL !Begin pTAL statement
CALL SET^FILE(RECV^FILEFCB,
SET^SYSTEMMESSAGESMANY,,,@MASK);
?ENDIF PTAL !End pTAL statement
?IFNOT PTAL !Begin TAL statement
CALL SET^FILE(RECV^SYSTEMMESSAGESMANY,@MASK)
?ENDIF PTAL !End TAL statement
Specifically, the process receives the following system messages:
Refer to the Guardian Procedure Calls Reference Manual for a complete list of all
system messages and mask-bit positions.
Reading System Messages
Use the READ^FILE procedure to read a system message from the $RECEIVE file. If
the message you read is a system message, then the READ^FILE procedure returns
error number 6, assuming you requested to receive this message using the SET^FILE
SET^SYSTEMMESSAGES[MANY] operation:
ERROR := READ^FILE(RECEIVE^FILE^FCB,BUFFER,BYTES^READ);
IF ERROR = 6 THEN
BEGIN
!Process system message
END;
Handling BREAK Ownership
This subsection describes how to use the CHECK^BREAK, GIVE^BREAK, and
TAKE^BREAK procedures to manipulate BREAK ownership and respond to the
pressing of the BREAK key.
Word Bit Message
0 2 (-2) Processor down
1 14 (-103 or -30) Open
1 15 (-104 or -31) Close
3 4 (-110) Loss of communication with network node
3 6 (-100) Remote Processor down