HPlogo Asynchronous Serial Communications Programmer's Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 8 Intrinsics Reference

READX

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

Transfers a record of data from the file $STDINX to the data area.

Syntax

     I16               CA         I16V
transfercount:=READX(message,expectedlength);

Use

The READX intrinsic reads an ASCII string from $STDINX into an array. This is similar to calling the FREAD intrinsic against the file $STDINX. READX is intended as a quick method of obtaining input from the terminal for temporary programming. Read timers or timeouts must be set prior to calling READX by first calling FCONTROL using the appropriate controlcode values.

When you use the READ intrinsic, the full capabilities of the file system are not available to you. For example, since no file number can be specified in the call, it is not possible to use the :FILE command to redirect input for programs using READX. (The only way that input can be redirected is to use the $STDINX=filename option of the :RUN command.) Input always comes from the $STDINX file opened by the session at logon time.

READX differs from READ in how it interprets an end-of-file. READX interprets :EOD as an end-of-file indication.

Functional Return

transfercount

16-bit signed integer (assigned functional return)

The length of the ASCII string that was read. If expectedlength is positive, the count represents halfwords. If expectedlength is negative, the count represents bytes.

Parameters

message

character array (required)

Returns the ASCII characters that were read. Note that all character arrays must start on a halfword boundary

expectedlength

16-bit signed integer by value (required)

The maximum length of the message array. If expectedlength is positive, it specifies the length in halfwords. If expectedlength is negative, it specifies the length in bytes. When the record is read, the first expectedlength characters are input. If the number of bytes input exceeds this value, the read terminates on byte count.

Condition Codes

CCE

Request granted.

CCG

An :EOD was encountered.

CCL

Request denied. A physical input/output error occurred. Further analysis through the FCHECK intrinsic is not possible.

Additional Discussion

See the discussion of reading ASCII strings from $STDINX into an array in Accessing Files Programmer's Guide.

Feedback to webmaster