Chapter 8 Summary


[Page 454]

  1. When sequential files are opened, we must specify whether they will be read from with a StreamReader or written to with a StreamWriter. Output files can be created anew (File.CreateText) or just added to (File.AppendText). A line of data is written to a file with the WriteLine method and read from a file with the ReadLine method.

  2. Structured exception handling can reduce the likelihood that a program will crash. If an exception occurs while the code in the Try block is running, execution branches to the code in a Catch block that alerts the user of a mishap. The Finally block does its best to clean up before the program moves on to other tasks.

  3. When data are stored with CSV format, an entire record is placed in a single line with fields separated by commas.

  4. A sequential file can be ordered by placing its data in an array of structures, sorting the array, and then writing the ordered data into a file.




An Introduction to Programming Using Visual Basic 2005
Introduction to Programming Using Visual Basic 2005, An (6th Edition)
ISBN: 0130306541
EAN: 2147483647
Year: 2006
Pages: 164

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net