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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.