EasyManua.ls Logo

Apple IIe - Page 217

Apple IIe
320 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Cassette
and
Disk Storage with
the
Apple lie 217
The READ statement must be issued in a PRINT statement and
must be preceded
with
the
Ctrl-D
character.
Once
a READ
command
has
been issued, INPUT statements
will
accept data
from
the
file
specified in
filename
until
a subsequent DOS
command
or
an
error
cancels READ.
The
following
illustrates
the
use
of
READ:
100
D$ = CHR$(4)
110
PRINT
D$
; "
OPEN
TEXTA
"
120
PRINT
D$
; "
READ
TEXT
A"
130
INPUT
X$
140
PRINT
X$
150
PRINT
D$
; "
CLOSE
TEXT
A"
160
END
]RUN
THIS
IS
THE
NEW DATA
l
In Applesoft,
the
GET
statement can also be used
to
read data
from
a disk
file
.
Unl
ike INPUT,
GET
returns just
one
character.
Therefore,
if
our
text file included the
following
phrase:
THIS
IS
THE
NEW DATA
after
an
OPEN and READ
were
executed,
the
first
GET
statement
would
return
the
letter
T, the second
GET
statement
would
return the letter H, etc.
The
following
program illustrates
the
use
of
GET
to
read data
from
a text file:
100
D$
= CHR$
(4)
110
PRINT
D$
; "
OPEN
TEXT
A"
120
PRINT
D$
; "
READ
TEXT
A"
130
X$
=" "
140
GET
Y$
150
IF
Y$
= CHR$ (
13
)
THEN
180
160
X$
=
X$
+
Y$
170
GOTO
140

Other manuals for Apple IIe

Related product manuals