![Texas Instruments PHP1240 Скачать руководство пользователя страница 35](http://html.mh-extra.com/html/texas-instruments/php1240/php1240_manual_1097136035.webp)
SEQUENTIAL files have either FIXED or VARIABLE-length records. If
you do not specify a
record-type
for a SEQUENTIAL file. the default is
VARIABLE. A file with FIXED-length records may be reopened for either
SEQUENTIAL or RELATIVE access.
The following are examples of OPEN statements.
OPEN #1 :"OSK1 .MYFILE"
OPEN #23: "DSK.MYDISK,X' ·
•
RELATIVE
1 OO.INTERNAL.OUTPUT.FIXED
80
OPEN #243:A$.INTERNAL
Creates or reopens a file on the diskette in drive
one with a namj! of MYFILE. The file is a
SEQUENTIAL file in the UPDATE mode with
DISPLAY format and VARIABLE length records
having a maximum length of 80 bytes. (These
are the default attributes assigned by the
computer.)
Creates or reopens a file named X on the
diskette named MYDISK in whichever drive It is
located. The file is a RELATIVE file in the
OUTPUT mode with INTERNAL format and
FIXED-length records having a maximum length
of 80 bytes. Initially. 100 records are made
available for the file. if enough room exists on
the diskette.
Creates or reopens a file on the diskette in drive
two with a name of ABCD if A$ equals
DSK2.ABCD. The file is a SEQUENTIAL file in
the UPDATE mode with INTERNAL format and
VARIABLE-length records having a maximum
length of 80 bytes.
CLOSE - The CLOSE statement discontinues the association between a file and a
program. After the CLOSE statement is performed. the file is not available unless It is
opened again with an OPEN statement. Files may optionally be deleted by adding
:DELETE to the end of the CLOSE statement.
The CLOSE statement has the following general form:
CLOSE #file-number [ :DELETE]
ThejUe-number
is the number which you used in the OPEN statement to open the file.
If you do not close a file. data on It may be lost. If a program ends due to a BREAK
statement. by your pressing
CLEAR.
or because of an error. files may not be closed even
if you have a CLOSE statement later in the program. However. you can close the files
properly by entering CLOSE
#flle-number.
NEW. or BYE if you wish to leave BASIC.
Editing the program also automatically closes any open files.
Note:
If you leave TI BASIC by pressing
QUIT.
data may be lost. Leave TI BASIC only by
entering BYE when you are processing files.
32
Содержание PHP1240
Страница 1: ......