14.6 File and Record Operations
You can perform a variety of operations on files and on the
records within a file. The following is a list of all the file and
record operations supported by BASIC:
.
Open a file for processing with the OPEN statement
.
Locate a record in a file with the FIND statement
.
Read a record from a file with the GET statement
.
Write a record to a file with the PUT statement
.
Delete a record from a file with the DELETE statement
.
Change the contents of a record field with the UPDATE
statement
.
Unlock the last record accessed with the UNLOCK
statement
.
Unlock all previously locked records with the FREE
statement
.
Write data to a terminal-format file with the PRINT #
statement
.
Reset the current record pointer to the beginning of a file
with the RESTORE # and RESET # statements
.
Delete all the records after a certain point; that is, trun-
cate the records, with the SCRATCH statement
.
Rename a file with the NAME AS statement
.
Close an open file with the CLOSE statement
.
Delete an entire file with the KILL statement
Note that before you can perform any operations on the
records in a file, you must first open the file for processing.