32 Part I Getting Started with Microsoft Visual Basic 2010
contain only one project (the situation for most programs in this book). The second
option causes Visual Studio to postpone saving your project until you click the Save
All command on the File menu and provide a location for saving the file. This “delayed
save” feature allows you to create a test program, compile and debug the program,
and even run it without actually saving the project on disk—a useful feature when you
want to create a quick test program that you might want to discard instead of saving.
(An equivalent situation in word-processing terms is when you open a new Word
document, enter an address for a mailing label, print the address, and then exit Word
without saving the file .) With this default setting, the exercises in this book prompt you
to save your projects after you create them, although you can also save your projects
in advance by selecting the Save New Projects When Created check box.
You’ll also notice that I have typed “C:\Vb10sbs” in the Projects Location text box to
indicate the default location for this book’s sample files. Most of the projects that
you create will be stored in this folder, and they will have a “My” prefix to distinguish
them from the completed project I provide for you to examine. (Be sure to change this
setting on your computer as well .)
After you have adjusted these settings, you’re ready to check four Visual Basic compiler
settings.
- Click the VB Defaults item in the Options dialog box.
Visual Studio displays a list of four compiler settings: Option Explicit, Option Strict,
Option Compare, and Option Infer. Your screen looks like this:
Although a detailed description of these settings is beyond the scope of this chapter,
you’ll want to verify that Option Explicit is set to On and Option Strict is set to Off—the
default settings for Visual Basic programming within Visual Studio. Option Explicit On