Close - Commodore 1541 User Manual

Disk drive
Hide thumbs Also See for 1541:
Table of Contents

Advertisement

CLOSE
It is extremely important that you properly CLOSE filesonce you are finished
using them. Closing the file causes the DOS to properly allocate blocks in the BAM
and to finish the entry in the directory. If you don't CLOSE the file, all your data will
be lost!
FORMAT FOR CLOSE STATEMENT:
CLOSE file#
You should also be careful not to CLOSE the error channel (channel# 15) before
CLOSEing your data channels. The error channel should be OPENed first and
CLOSEd last of all your files! That will keep your programs out of trouble.
If you close the error channel while other files are OPEN, the disk drive will
CLOSE them for you, but BASIC will still think they are open (unless you CLOSE
them properly), and let you to try to write to them.
NOTE: If your BASIC program leads you into an error condition, all files are
CLOSEd in BASIC, without CLOSEing them on your disk drive! This is a very
dangerous condition. You should immediately type the statement OPEN 15, 8, 15,
"I". This will re-initialize your drive and make all your files safe.
19

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents