| READNEXT | Index Level | READTL |
| Syntax | READT variable [THEN | ELSE | ONERR statement.block] |
| Category | BASIC |
| Type | Statement |
| Description |
reads a tape record and assigns the value returned to a specified variable.
The length of the tape record is specified by the most recently executed "t-att" command. The "then" clause is taken if the operation is successful. Either "else" or "onerr" can be specified, but not both. If the tape unit has not been attached or if an end-of-file (EOF) mark is read, the "else" or "onerr" clause, if present, is executed. In addition, the "onerr" statement can be used to check for end-of-tape (EOT), tape unit not ready, parity error, or block transfer error. See the system(0) function. See the "then/else construct" for an explanation on the use of "then" and "else" clauses in statements that allow or require them. |
| Options | |
| See Also | REWIND THEN | ELSE statement.block THEN statement.block t-att WEOF WRITET ONERR statements & functions READTL READTX t-select t-stat SYSTEM set-sct |
| Example |
execute 't-att'
rewind else stop eot=0 loop readt rec else eot=1 until eot do print trim(rec[1,25]) repeat Reads a series of tape records and displays the first 25 bytes of each record. The "readt" else clause is usually taken when an end-of-tape or end-of-data condition is reached. The "system(0)" function indicates whether there are any other unexpected problems. |
| Warnings | |
| Compatibility | D3 7.0 AP R83 |
| READNEXT | Index Level | READTL |