
File Naming Conventions
A filename can be up to ten characters long and may contain any character except the
period and the space character. However. the Disk Manager module recognizes
only
characters with ASCII codes of 32 through 95. For best results. use only upper-case
characters A through Z and other characters with ASCII codes of 95 and lower
(excluding the period and the space character) to name your files.
File Processing
There are seven main Tl BASIC statements that are used to access files on diskettes.
They are OPEN. CLOSE. INPUT. PRINT. EOF. RESTORE. and DELETE. In addition. a
special subprogram named CALL FILES lets you change the number of files allowed to
be opened at the same time. The following discussions of each of these statements
relate to their use with the disk system.
OPEN - The OPEN statement prepares a TI BASIC program to use data files stored on
diskettes. It provides a link between a file-number used In a program and the file on the
diskette. and it describes a file's characteristics so that a program can process or create
the file. If the file already exists. the description that is given In the program must
match the actual characteristics of the file.
The OPEN statement has the following general form:
OPEN #f�e-number:"device.file-name" [ ,fie-organization] [,fiie-type] [,open-mode]
[ ,record-type ]
Thefile-number
and
devtceJile-name
must be Included In the OPEN statement. The
other Information may be In any order or may be omitted. If an item is omitted. the
computer assumes certain defaults. which are described below .
30
•
file-number - Thefile-number
(1 through 255 or an expression) Is
assigned to a particular file by the OPEN statement. (File number 0 is
the keyboard and screen of the computer. lt cannot be used for other
files and is always open.) You may assign file numbers as you wish. with
each file having a different number.
Thefile-number
Is entered as a number sign
(#)
followed by a number or
a numeric expression that. when rounded to the nearest Integer. Is a
number from 1 to 255 and Is not the number of a file that Is already
open .
•
devtceJtle-name
-
The
devtce
refers to the diskette on which a
particular file Is stored. If a file Is on a diskette In disk drive one. the
device is DSKl . For drive two. the device is DSK2. For drive three. the
device is DSK3.
Thefile-name
may be any valid file name.
Instead of the disk drive number you may use DSK followed by a period.
the diskette name. a period. and then the file-name.
OPEN #1 :"DSK.oISKETTE1 .FILE1 "
The computer will search all drives for the diskette with the name you
give.
Содержание PHP1240
Страница 1: ......