Tandy 1000 Basic Reference Manual page 245

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter
10
I BASIC Kevwords
You may open a file for output in only one buffer at a time. Once
you assign a buffer t o a file with the
OPEN
statement, you can-
not use that buffer in another
OPEN
statement until you close
the first file. However, BASIC lets you access the same file for in-
put by opening it in different buffers. You may keep several rec-
ords from the same file in memory for quick access.
If you open a file for input that does not exist, BASIC returns a
"File not found" error.
If you open a file for output that does not exist, BASIC creates
the file.
If you open a file for append that does not exist, BASIC creates
the file and sets the mode to RANDOM.
If you open a file for direct access with a record length that does
not match the record length assigned to the file when it was cre-
ated, an error occurs.
Examples
OPEN " R " ,
2 ,
" t e s t
. d a t "
opens the file
test.dat
in direct access mode, using Buffer 2. If
test.dat
does not exist, BASIC creates it on the current drive.
The record length is 128 bytes.
OPEN " L P T I
: I '
FOR OUTPUT A S 2
opens the printer for sequential output using Buffer 2.
OPEN " A : \ P A Y R O L L \ d a t a . b a 3 "
F O R I N P U T A S 1
opens the file
databas
in the
PAYROLL
directory on Drive A for
sequential input using Buffer 1.
243

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents