The REWIND statement rewinds the attached magnetic tape or floppy disk to the Beginning-of-Tape.
REWIND [RETURNING var] [THEN statements END] ELSE statements END |
Parameter(s)
RETURNING var |
If a tape or floppy disk error occurs while using the RETURNING clause, the tape or floppy disk error is assigned to the returning variable and program control continues through the ELSE clause. |
THEN statements |
Executes statements if tape or floppy disk is attached and successfully rewound. |
ELSE statements |
Executes statements if tape or floppy disk is not attached. |
Description
The REWIND statement may be used to rewind a magnetic tape or floppy disk to the Beginning-Of-Tape (BOT) position. If the tape or floppy disk is not attached, the ELSE clause is executed.
Example
In this application, all records on a tape are to be displayed on the screen. Before the records can be read via a READT statement, the REWIND statement is used to ensure that the tape is positioned at the beginning.
REWIND ELSE PRINT "TAPE NOT ATTACHED!" GOSUB EXIT END LOOP READT RECORD ELSE . . . |
See Also