[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]

variable-name into which the KERNAL puts the STATUS of I/O operations. A table of STATUS code values for tape, printer, disk and RS-232 file operations is shown below:

ST Bit Position ST Numeric Value Cassette Read Serial Bus R/W Tape Verify + Load
0 1   time out write  
1 2   time out read  
2 4 short block   short block
3 8 long block   long block
4 16 unrecoverable read error any mismatch
5 32 checksum error   checksum error
6 64 end of file EOI  
7 -128 end of tape device not presentend of tape

EXAMPLES of STATUS Function:

   10 OPEN 1,4:OPEN 2,8,4,"MASTER FILE,SEQ,W"
   20 GOSUB 100:REM CHECK STATUS
   30 INPUT#2,A$,B,C
   40 IF STATUS AND 64 THEN 80:REM HANDLE END-OF-FILE
   50 GOSUB 100:REM CHECK STATUS
   60 PRINT#1,A$,B;C
   70 GOTO 20
   80 CLOSE1:CLOSE2
   90 GOSUB 100:END
   100 IF ST > 0 THEN 9000:REM HANDLE FILE I/O ERROR
   110 RETURN

[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]
This page has been created by Sami Rautiainen.
Read the small print. Last updated November 08, 1998.