18.3. Files and Streams

Visual Basic views a file as a sequential stream of bytes (Fig. 18.2). Depending on the operating system, each file ends either with an end-of-file marker or at a specific byte number that is recorded in a system-maintained administrative data structure. For example, the Windows keeps track of the number of bytes in a file. When you open a file from a Visual Basic program, an object is created and a stream is associated with the object. When a program executes, the runtime environment creates three stream objects that are accessible via properties Console.Out, Console.In and Console.Error, respectively. These objects facilitate communication between a program and a particular file or device. Console.In refers to the

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.