18.08.2013 Views

(SYSLIB) Programming Reference Manual - Public Support Login ...

(SYSLIB) Programming Reference Manual - Public Support Login ...

(SYSLIB) Programming Reference Manual - Public Support Login ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

17.2.3.2. Read Procedure Call (S$ARREAD)<br />

SAR$ READ<br />

The S$ARREAD PROC returns one image from the symbolic input to the calling program,<br />

placing the character text in the text buffer and the attributes in the attribute table.<br />

Initial Conditions<br />

The calling program sets the following parameters in the READ packet to appropriate<br />

values before calling S$ARREAD:<br />

• Required parameters (described in 17.2.1.1)<br />

SR$TEXBUF<br />

SR$ATTRIBL<br />

SR$TEXBUFL<br />

SR$ATTRIB<br />

• Optional parameters (described in 17.2.1.2)<br />

SR$ADDRSEC<br />

SR$SELLSTL<br />

SR$ADDRWO<br />

SR$SELLST<br />

Calling Format<br />

S$ARREAD rpkt<br />

error return<br />

end-of-file return<br />

normal return<br />

where rpkt is a label identifying the starting address of the READ packet and data area.<br />

Returns<br />

Each call to S$ARREAD reads one image from the input. If the normal return is taken,<br />

S$ARREAD returns the character text in the text buffer, the attributes in the attribute<br />

table, and other information in the READ packet. S$ARREAD does not space-fill the text<br />

buffer if the text length is shorter than the text buffer length. If the text length is longer<br />

than the text buffer, S$ARREAD truncates the text to the length of the text buffer and<br />

takes the error return. See 17.2.1.3 for a list of the fields that contain information<br />

returned by S$ARREAD to the calling program.<br />

If the error return from S$ARREAD is taken, A1 contains the call status code, A2<br />

contains the I/O status code, and A3 contains the substatus code. These status codes<br />

are also returned in the packet fields SR$CALLST, SR$IOSTAT, and T1 of SR$STATUS,<br />

respectively. See 17.2.4 for an explanation of the status codes.<br />

If the end-of-file return from S$ARREAD is taken, the last read request encountered an<br />

end-of-file condition. A1 contains the call status code, A2 contains the I/O status code,<br />

and A3 contains the substatus code. These status codes are also returned in the packet<br />

fields SR$CALLST, SR$IOSTAT, and T1 of SR$STATUS, respectively.<br />

7833 1733–004 17–29

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!