18.6. Reading Data from a Sequential-Access Text File

The preceding section demonstrated how to create a file for use in sequential-access applications. In this section, we discuss how to read (or retrieve) data sequentially from a file.

Class FrmReadSequentialAccessFile (Fig. 18.11) reads records from the file created in Fig. 18.9, then displays the contents of each record. Much of the code in this example is similar to that in Fig. 18.9, so we discuss only the unique aspects of the application.

Figure 18.11. Reading sequential-access files.
					' Fig. 18.11: FrmReadSequentialAccessFile.vb
					' Reading a sequential-access file.
					Imports System.IO
					Imports BankLibrary ' imports classes from Figs. 18.7 and 18.8
					Public Class FrmReadSequentialAccessFile ...

Get Visual Basic 2005 for Programmers: Deitel Developer Series, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.