ACCESS A SEQUENTIAL FILE
ACCESS A SEQUENTIAL FILE Data stored in a sequential file can read in order and assigned to variables with the following steps: 1. Choose a number from 1 through 255 to be the reference number of the file. This number is not necessary to be the same number that was used when the file was recorded. 2. Execute the statement OPEN filename FOR INPUT AS #n Where n is the reference number. This procedure is referred to as opening a file for input. It establishes a communication line between the computer and the disk drive for reading data from the diskette. 3. Read data from the file with the INPUT* statement. INPUT* statement assigns data from file to variable. INPUT #n. var1, var2, …… 4. After the desired items have been found or all the data has been read from the file, close the file with the statement CLOSE #n. 5. Basic function EOF; it tells us if we have reached the end of a file. For example the condition EOF (n) will be true if the en