Envoy Application Programming Manual

Table Of Contents
File-System Procedures
Envoy Application Programming Manual427159-001
C-36
WRITEREAD[X]
Examples
CALL WRITEREAD (fnum,buffer,52,102);
where fnum is the name of the one-word integer variable specified in the OPEN call
that opened the particular communications line. buffer is the name of the integer array in
the application program to be used first for a WRITE operation and then for a READ
operation. The write count of 52 specifies that we want to transmit a message containing
50 bytes of data (this count also includes the two-byte MCW). The read count of 102
specifies that an incoming message containing up to 100 bytes of data (this count also
includes the two-byte MCW that is going to be received).
CALL WRITEREAD (fnum,buffer,52,102,in^count);
This example is the same as the preceding one except that the WRITEREAD call
includes in^count, which is the name of an integer variable into which Envoy places
a value specifying how many bytes were actually deposited into the application buffer as
a result of the READ operation. If the message received was the maximum size, then
in^count is set to 102. If, however, the incoming message contained only 10 bytes of
data, then in^count is set to 12.