The Putiget Commands - Atari DOS 2.5: XF551 Owner's Manual

Atari dos 2.5 disk drive
Table of Contents

Advertisement

The POT/GET Commands
PUT (PU.)
Format
: PUT Hiocb
,
aexp
Example:
100 PUT
#6,
A:3C( "A")
The
PUT command
writes
a single byte (value from 0 to 255) to
the device specified by the IOCB reference
number.
In the sam-
ple program
below,
the PUT command is
used
to write each
number you type into an array dimensioned as
A(50).
You can
enter up to
50
numbers
,
each of
which
must be less than 256 but
greater
than
or equal to zero
.
This command is
used to
create
data files or to append data to an existing
file.
GET (GE.)
Format: GET
#iQcb,
avar
Example:
100 GET
#2,
X
This command
reads
a single
byte
from the device specified by
the IOCB
ref~rence
number into the specified variable. GET
allows you to retrieve
each
byte stored by the
PUT
command.
The sample program shown below demonstrates
PUT
and
GET.
In the
GET
part
of the program (lines 130 to 230)
,
rather than
using a
TRAP
statement to sense an end·of-file
error,
a zero byte
(entered by you)
has
been
used
to
determine
the
end
of data.
10
REM**PUT
/
GET DEMO**
20
DIM
A(50),AS(10)
30
? "PUT
AtHI
GET TO DISK
PF~OC,;RA~l
EXA~lPLE·'
,?
40
?
"IS
THIS TO BE A READ
OR
A
WRITE?"
'INPUT
RI
'?
50
IF AS="
F~EAD"
THE~l
170
60
IF
A$<>"~~RITE"
THEN PRINT
"?":
74
GOTO 40
70
REM WRITE ROUTINE
80 OPEN
#1,8,O,
"D1:EXAMPL1.DAT"
90
?
"ENTER
A NUMBER
LESS
THAN
256":P
RItH
"(0 TO
Et~D)";
INPUT
:~~

Advertisement

Table of Contents
loading

This manual is also suitable for:

Xf551

Table of Contents