UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software

rocketsoftware.com
from rocketsoftware.com More from this publisher
11.04.2013 Views

READT Syntax READT [UNIT (mu.expr)] var {THEN statements [END] | ELSE statements [END]} Description The UniBasic READT command reads the next record from a tape and assigns it to a variable. Note: Before you use the READT command, you must attach a tape drive with the T.ATT command. For information about tape commands, see the UniData Commands Reference. You must use the TAPELEN option for the T.ATT command and specify the length of the tape in megabytes. This command is intended for use with UniData tapes only. UniData uses the ASCII 0 character (CHAR(0)) as an end-of-record mark. Therefore, you cannot use ASCII 0 in any string variable in UniBasic. READT converts (CHAR(0)) to CHAR(128). 1-640 UniBasic Commands Reference

Parameters The following table describes each parameter of the syntax. Parameter Description UNIT (mu.expr) Specifies the conversion code (first digit), and the unit number (second digit). UniData allows unit numbers from 0 through 9. mu.expr is optional. The default value is 00, indicating tape unit 0 and no conversion: 0 – No conversion (ASCII assumed) 1 – EBCDIC conversion 2 – Invert high bit 3 – Swap bytes var Specifies a variable to contain the record. THEN statements END THEN executes if the read is successful. END is required to terminate multiline THEN statements. ELSE statements END ELSE executes if the read is not successful or the record does not exist. END is required to terminate multiline ELSE statements. READT Parameters STATUS Function Return Values After you execute READT, the STATUS function returns one of the values described in the following table. Value Description 0 Successful read. 1 End of file encountered. 2 End of tape encountered. 3 Tape not assigned. STATUS Function Return Values READT 1-641

READT<br />

Syntax<br />

READT [UNIT (mu.expr)] var {THEN statements [END] | ELSE statements<br />

[END]}<br />

Description<br />

The <strong>UniBasic</strong> READT command reads the next record from a tape and assigns it to<br />

a variable.<br />

Note: Before you use the READT command, you must attach a tape drive with the<br />

T.ATT command. For information about tape commands, see the UniData<br />

<strong>Commands</strong> <strong>Reference</strong>. You must use the TAPELEN option for the T.ATT command<br />

and specify the length of the tape in megabytes. This command is intended for use<br />

with UniData tapes only.<br />

UniData uses the ASCII 0 character (CHAR(0)) as an end-of-record mark. Therefore,<br />

you cannot use ASCII 0 in any string variable in <strong>UniBasic</strong>. READT converts<br />

(CHAR(0)) to CHAR(128).<br />

1-640 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong>

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

Saved successfully!

Ooh no, something went wrong!