EasyManua.ls Logo

Texas Instruments TI-99/4A - Page 139

Texas Instruments TI-99/4A
204 pages
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...
OPEN
>100
OPEN
#2:"CS1",SEQUENTIAL
,INTERNAL,INPUT,FIXED
128,PE
RMANENT
OPEN
#file"number:flle-namel,flle-organizationll ,file-typell,open-modell ,record·typell,file-lifel
Exampl2s~
The
OPEN
statement
prepares
a BASIC
program
to use
data
files
stored
on accessory devices.
The
OPEN
statement
does this by
prnvicling
thp npcpssary link
between
a file-number
used
in your
program
and
the
particular
accessory device on
which
the file
is
located_
The
OPEN
statement
describes a file's
characteristics
to the
computer
so
that
your
program
can
process it or
create
it. With
some
accessory devices the
computer
will
check
that
the
file or
device
characteristics
match
the informatIOn specified in
the
OPEN
statement
for
that
file.
If
they don"t
match
or
the
computer
cannot
find
or
create
the file. the file will not be opened
and
an
I/O
error
message
will be
printed,
The
file-number
and
file-name
must
be included in the
OPEN
statement_
The
other
illfUllllatioJ1
can
be
included in any
order
or
can
be omitted.
If
you leave
out
any specification, the
computer
will
assume
certain
standard
characteristics
for
the
file, called
"defaults,"
as
described
later
in this section.
File-number -
All
TI
BASTC stMp-mpnts
which
refer
to
files do so
by
means
of a file-number
between
0 and 255 inclusive.
The
file·
number
is assigned to a
particular
file by
the
OPEN
statement.
Since
!1le-number 0 refers
to
the kpyhoMcI
and
screen
of your
computer
and
is always accessible, you
cannot
open
or
close file-
number
0 in your
program
statements.
You
may
assign the
other
numbers
as
you wish.
as
long
as
each
open
file in your
program
has
a different
number.
The
file-number
is
entered
as the
number
sign (#) followed by a
numeric
expression. When the
computer
evaluates
this
expression
and
rounds
the
answer
to the
nearest
integer, the
number
must
be t to 255 inclusive
and
cannot
be
the
same
file-
number
as
any
other
file you
are
using
concurrently
in the
program
.
file-name - A file-name refers
to
a device
UI
tu
i:l
fIle
located
on
a
device,
depending
on
the capability
of
the accessory.
Each
accessory
has
a predefined
name
which
the
computer
recognizes.
For
example,
the
valid file·names for the two audiu
cd:;::;clle
recorders
are
"CSt"
and
TS2."
By
including this file·name in the
OPEN
statement
you
are
telling
the
computer
to access a
particular
hie
or
device
whenever
the
program
references the
associated
file-number.
The
l1Je-name
can
be
any
string
expression
which
evaluates
to a valid file-name.
If
you use a
string
constant,
you
must
enclose it in quotes.
>100
OPEN
#25:"CS1",SEQUENTlA
L,INTERNAL,INPUT,FIXED,PFRMA
NENT
>110 X=100
>120
OPEN
IIX+S:"CSZ",SEQUENTI
AL,INTERNAL,OUTPUT,FIXED,PER
MANENT
>130
N=2
>140
OPEN
#122:"CS"&STR$(Nl,S
EQUENTIAL,INTERNAL,aUTPUT,FI
XED,PERMANEIH
User's
Reference
Guide
Tl·119

Other manuals for Texas Instruments TI-99/4A

Related product manuals