[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.29 READ

The READ command takes input from I/O channel $IO and stores it into specified variables, provided the optional postcondition evaluates to true or is omitted.

Syntax

READ[:postcondition] read-argument[,...read-argument]

Each read-argument may be one of the following:

String Literal

String literal read-arguments will be output to $IO unmodified.

Format Specifier

One or more of the following:

! (newline)

Advances the cursor down by one line and returns it to the first column.

# (form-feed)

Advances the screen down by $ZROWS and moves the cursor to the upper-left corner of the screen.

?n (position)

Advances the cursor and $X forward to position n.

Single-Character Read (*variable-name[:timeout])

Reads one character into variable variable-name. If the optional timeout is specified, will wait timeout seconds to retrieve one character. If a character is read within timeout seconds, $TEST will be set to 1. If no character is read within timeout seconds, $TEST will be set to 0.

Variable-Length Character Read (variable-name[:timeout])

Reads characters into variable-name until the character or character pair in ^$DEVICE(io-channel,"OPTIONS","TERMINATOR") is encountered. If the optional timeout is specified, will wait timeout seconds to retrieve characters. If characters are read within timeout seconds, $TEST will be set to 1. If no character is read within timeout seconds, $TEST will be set to 0.

Fixed-Length Character Read (variable-name#count[:timeout])

Reads count characters into variable-name. If the optional timeout is specified, will wait timeout seconds to retrieve characters. If characters are read within timeout seconds, $TEST will be set to 1. If no character is read within timeout seconds, $TEST will be set to 0.

Control Mnemonic (/control-mnemonic[(arg1[,...argN])])

Outputs X3.64 control mnemonic control-mnemonic to $IO. Please see the appendix on X3.64 Control Mnemonics for more information.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on November 11, 2022 using texi2html 5.0.