The following statements make use of a feature known as default file variables:
When a file is opened with an open statement, it is usually assigned to a file variable for referencing the file later in the program with any of the above statements. This takes the general form:
open "customers" to customer.file else...
The operative word here is to. In this case, it assigns the actual location (represented internally as a base, modulo and separation) to the customer file variable. Later in the program, when an item is read from the file, the file variable displays in the appropriate form of a read statement, as in the form:
read customer.item from customer.file else...
Here, the operative word is from. With default file variables, nothing is explicitly assigned during the open statement, as in the form:
open "customers" else...
Therefore, any subsequent attempt to read from or write to the file does not require the file variable reference, as illustrated in the form:
read customer.item else...
There can be only one default file variable in a BASIC program. Any subsequent file needed for input or output must have an explicitly assigned file variable during the open statement, or it takes the place of the default file.
base, clear statement, clearfile statement, close statement, common statement, convert statement, convert() function, Data representation, delete statement, clearfile statement, matread statement, matwrite statement, matwriteu statement, open statement, read statement, readv statement, release statement, Reserved words, clearselect statement, write statement, writev statement, writevu statement