Zebra0.com

visual-basic filesVisual Basic: Windows Programming

Visual Basic: Windows Programming

Learn Visual Basic in FREE step-by-step lessons.

Files in Visual Basic

There are two types of files that can be created: text files and binary files.

Text files have variable length records. (One line of text may have 20 characters, the next line 5, etc.) A text file must be read sequentially: line 1, then line 2, etc. Text files are also called sequential files. We will learn about text files in this lesson.

Each record in a binary file must be exactly the same size. Because all of the records are the same length, a binary file can be read either sequentially or randomly. Suppose each record has exactly 20 bytes. The location of the first record in the file is always known. The second record begins 20 bytes past that. The fifth record begins 80 bytes past the beginning of the file. If the position where each record starts can be calculated, then we can read the Nth record without reading all of the records before it. Binary files are also called Random Access files.

In this lesson we will also look at some commands for working with files and folders.

Please study the material at each of the links below.

  1. Directory

  2. Browse for Folder

  3. Display the Picture

  4. Simple Picture Viewer

  5. Text Files

  6. Creating a lookup list from a file

  7. Menu List

  8. Save

  9. Do you want to save?

  10. On Closing

  11. Reformatting Files

  12. Save as XML

GlossaryGlossary for files lesson
Full Glossary