1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

The most simple commands to use the disk are to load and save your
Applesoft program, called 'LOAD filename' and 'SAVE filename'
respectively. [If you omit the filename on a machine with cassette
ports (][, ][+ and //e), it will attempt to read/write from the
cassette ports in back, and seem to hang if a system is not connected]
Once saved to disk, you can access the program later; 'RUN filename'
can be used to both LOAD and RUN a saved Applesoft program.

'CATALOG' (case sensitive) under DOS 3.3 will show a listing of all
files. Under ProDOS, 'catalog' (case insensitive) gives a listing
formatted for 80-column displays; 'cat' deletes a few lesser used
(date/time modified, file size, etc) columns to fit nicely on a
40-column display.

'DELETE filename' deletes a file. File recovery is very difficult
under certain versions of ProDOS, so be sure only to delete what you
want.

5.2 Binary Files

Binary files (literally a memory image) can also be loaded and saved.
They can be saved with a 'BSAVE filename,Astart,Llen'. The starting
address in memory to save from and the length can be specified in
decimal or in hexadecimal (hex is preceeded by a $, so that 8192
decimal is represented by $2000). Under DOS 3.3, the start and length
parameters are required; under ProDOS, if they are omitted, the
parameters used when the file was created are used. [There are also
some more fun options under ProDOS; I'll get around to those later]

'BLOAD filename[,Astart][,Llen]' loads a file later. If omitted, the
address and length default to what was used when the file was saved;
if used, they override what was used when the file was saved. [Once
again, extra fun ProDOS options]

'BRUN filename[,Astart]' loads a binary file and starts executing it.
If it is not program code, the computer will probably have a nasty
crash. If omitted, the address defaults to what was used when the file
was saved.

5.3 Text File I/O

Text files written to under Basic can be of two forms: "Sequential
Access" and "Random Access." Sequential files can only be accessed a
line at a time, with each line accessed after the one before them.
Random Access files allow you to define 'records' for your input, and
then go to any records at will.

Both methods require you to 'OPEN' a file before any reading or
writing to it take place. 'OPEN'ing a file creates it on disk if it
does not exist. A sequential file is opened with a 'PRINT CHR$(4)"OPEN
filename"'.

A random access file has record of a certain length in bytes. Each one
may contain multiple pieces of text, but the text in them should not
go over the length, or you will write into the next record. When first
opened, you must specify the field length, e.g. 'PRINT CHR$(4)"OPEN
filename,Llen"'. Under DOS 3.3, you must specify the record length
each time you open the file; ProDOS recalls that for you from the
first time you created the file and can omit that parameter when
reopening a file.

When done with a file, your program should 'PRINT CHR$(4)"CLOSE
filename"' to close that specific file, or 'PRINT CHR$(4)"CLOSE"' to
close all open files. Applesoft or ProDOS does not automatically close
all open files when your program ends, and as output is buffered, your