Chapter
10
I
BASIC
Keywords
LOAD
Statement
LOAD
pathname
[,Rl
Loads a BASIC program from disk into memory.
Pathname
is a standard file specification used to save the file to
disk.
The
R
option tells BASIC to run the program. (LOAD with the
R
option
is
equivalent to the command
RUN
pathname.)
When you
specify the
R
option, BASIC leaves all open files open and runs
the program automatically. If you omit the
R
option, BASIC
wipes out any resident BASIC program, clears all variables, and
closes all open files.
You
can use either of these commands inside programs to allow
program chaining (one program calling another).
If
you attempt
to
LOAD a non-BASIC file, a "Direct statement in
file" error occurs.
Example
LOAD
"A:
progl
.
ba5"
loads
progl .bas
from Drive A, and then returns to the command
mode.
LOAD
"progl
.bas"
loads
progl
.bas.
Because no drive is specified, BASIC searches
for
progl
.bas
on the current drive.
206