qb45advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
File I/O Statements and Functions
  Programming Tasks   File I/O   Contents   Index
──────────────────────────────────────────────────────────────────────────────
Statements and Functions Used for File I/O
 
                            Statement or
Task                        Function         Action
 
Creating a new file or      OPEN             Opens a file for retrieving
accessing an existing                        or storing records (I/O)
file
 
Closing a file              CLOSE            Ends I/O to a file
 
Storing data in a file      PRINT #          Stores a list of variables as
                                             record fields in a previously
                                             opened sequential file
 
                            PRINT USING #    Similar to PRINT #, except
                                             PRINT USING # formats the
                                             record fields
 
                            WRITE #          Stores a list of variables as
                                             record fields in a previously
                                             opened sequential file
 
                            WIDTH            Specifies a standard length
                                             for each record in a
                                             sequential file
 
                            PUT              Stores the contents of a
                                             user-defined variable in a
                                             previously opened binary or
                                             random-access file
 
Retrieving data             INPUT #          Reads fields from a record
from a file                                  and assigns each field in the
                                             record to a program variable
                                             (sequential files)
 
                            INPUT$           Reads a string of characters
                                             from a file
 
                            LINE INPUT #     Reads a record from a
                                             sequential file and stores it
                                             in a single string variable
 
                            GET              Reads data from a binary or
                                             random-access file and
                                             assigns the data to elements
                                             of a user-defined variable
 
Managing files on disk      FILES            Prints a listing of the files
                                             in a specified directory
 
                            FREEFILE         Returns the next available
                                             file number
 
                            KILL             Deletes a file from the disk
 
                            NAME             Changes a file's name
 
Getting information         EOF              Tests whether all of the data
about a file                                 have been read from a file
 
                            FILEATTR         Returns the number assigned
                                             by the operating system to an
                                             open file and a number that
                                             indicates the mode in which
                                             the file was opened (INPUT,
                                             OUTPUT, APPEND, BINARY, or
                                             RANDOM)
 
                            LOC              Gives the current position
                                             within a file. With binary
                                             access, this is the byte
                                             position. With sequential
                                             access, this is the byte
                                             position divided by 128.
                                             With random access, this
                                             is the record number of the
                                             last record read or written.
 
                            LOF              Gives the number of bytes
                                             in an open file
 
                            SEEK (function)  Gives the location where the
                                             next I/O operation will take
                                             place. With random access,
                                             this is the number of the
                                             next record to be read or
                                             written. With all other kinds
                                             of file access, this is the
                                             byte position of the next byte
                                             to be read or written.
 
Moving around in a file     SEEK (statement) Sets the byte position for
                                             the next read or write
                                             operation in an open file