FORTRAN Reference Manual

Interprocess Communication
FORTRAN Reference Manual528615-001
14-10
Using the READ Statement PROMPT Specifier
shows the contents of iarr after a read operation that specifies SOURCE (declared as
SOURCE(16) for this example) completes successfully.
Using the READ Statement PROMPT Specifier
If the unit specified in a READ statement is a terminal or process, and the READ
statement includes a PROMPT specifier, FORTRAN calls the WRITEREAD system
procedure, rather than the READ system procedure. This enables a requester to send
a message (the prompt) to a terminal or another process and wait for a reply.
For a full description of the WRITEREAD system procedure, see the Guardian
Procedure Calls Reference Manual.
WRITE Statement With $RECEIVE
The WRITE statement can include either or both of the following specifiers for use with
$RECEIVE:
MSGNUM = msg-exp
msg-exp is the value from SOURCE(3) of the SOURCE array returned to your
program when it read the message for which the current WRITE statement is the
reply. The requester process uses msg-exp to match your program’s reply with the
original message sent by the requester. This is particular important to a requester if
it has written more than one message to your process.
REPLY = rep-exp
Table 14-1. Layout of Request Message From $RECEIVE Returned on READ
Statement
ENV OLD ENV COMMON Meaning
SOURCE(1) SOURCE(1) System flag: -1 if system message, 0 if user
message
SOURCE(2) SOURCE(2) Entry number of your process in the Guardian
requester table
SOURCE(3) SOURCE(3) Message number of your process in the Guardian
requester table
SOURCE(4) SOURCE(4) Opener's file number for this process
SOURCE(5:8) SOURCE(5:14) If ENV OLD is specified, contains the opener's
process identification (CRTPID) (character string)
If ENV COMMON is specified, contains the
opener’s process identification (process handle)
SOURCE(9) SOURCE(15) Number of bytes the requester expects to receive
in the reply to this message
SOURCE(10:16) SOURCE(16) Reserved for future use