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.
					1
					' Fig. 18.11: FrmReadSequentialAccessFile.vb
					2
					' Reading a sequential-access file.
					3
					Imports System.IO
 4
					Imports BankLibrary ' imports classes from Figs. 18.7 and 18.8
					5
					6
					Public Class FrmReadSequentialAccessFile ...

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

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