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

A secondary address value of one (1) OPENs cassette tape files for writing. A secondary address value of two (2) causes an end-of-tape marker to be written when the file is later closed. The end-of-tape marker prevents accidentally reading past the end of data which results in the BASIC error message ?DEVICE NOT PRESENT.

For disk files, the secondary addresses 2 thru 14 are available for data-files, but other numbers have special meanings in DOS commands. You must use a secondary address when using your disk drive(s). (See your disk drive manual for DOS command details.)

The <file-name> is a string of 1-16 characters and is optional for cassette or printer files. If the file <type> is left out the type of file will automatically default to the Program file unless the <mode> is given. Sequential files are OPENed for reading <mode>=R unless you specify that files should be OPENed for writing <mode> =W is specified. A file <type> can be used to OPEN an existing Relative file. Use REL for <type> with Relative files. Relative and Sequential files are for disk only.

If you try to access a file before it is OPENed the BASIC error message ?FILE NOT OPEN will occur. If you try to OPEN a file for reading which does not exist the BASIC error message ?FILE NOT FOUND will occur. If a file is OPENed to disk for writing and the file-name already exists, the DOS error message FILE EXISTS occurs. There is no check of this type available for tape files, so be sure that the tape is properly positioned or you might accidentally write over some data that had previously been SAVEd. If a file is OPENed that is already OPEN, the BASIC error message FILE OPEN occurs. (See Printer Manual for further details.)

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