132 User's
Handbook
to
the
Atari
400
/
800
Computers
EXAMPLES
OPEN
#2,4,0
, "D2:BUDGET
.BAS
"
OPEN
#3
,
12
, 0,
"D:NAMES"
If
only
one
disk is in use, the device name
is
simple
"D:"
.
If
2
or
more
disks are
being
used, the
number
of
the disk must
be
specified.
The
INPUT statement can al
so
be
us
ed
with
the keyboard. The
OPEN
statement
must
include
an
I/ O
channel
number,
operation
code
4,
special
operation
code 0, and the device
"K"
.
EXAMPLE
10
DIM
Y$(10)
20
OPEN
#2,
4, 0,
"K"
30
INPUT
#2
,
X,
Y$
40
PRINT
X,
Y$
50
CLOSE
#2
The previous example contains a
program
that
uses
the
keyboard
for
input.
Line
10
dimensions the variable
Y$.
Line
20
opens I/ O channel
#2
for
input
from
the keyboard.
When
line
30
is
executed,
the
program waits
for
input.
However,
no
prompt
symbol appears, and the data
is
not
displayed
when
it is
ente
red.
The first
variable in the I NPUT statement
is
X.
Since X
is
a
numeric
variable, a
numeric
data item must be
entered
first. The second
variable in the I NPUT statement
is
Y$.
Si
nce
Y$
is
a stri ng variable,
a string data
it
em must be entered next. A
comma
can be used
to
separate the data items,
or
each data
item
can be
followed
by
RETURN.
Line
40
displays the values
of
the
two
variab
les
, and line
50
closes
the
I/ O channel.
INT
The INT
function
returns the larg
est
int
eger that
is
le
ss
than
or
equal
to
the argument.