Datasheet

accident. This also helps you use the correct data types and avoid unnecessary conversions that may
make your program slower.
To avoid confusion and long debugging sessions, you should always set Option Explicit On and Option
Strict On. You can turn them on for a project using the project’s Property pages. To make them on by default
for new projects, open the Tools menu and select Options. Open the Projects and Solutions folder, select the
VB Defaults page, and turn the options on, as shown in Figure 1-16.
You will see many more options in Figure 1-16 if the Show all settings check box is selected.
The final compiler directive, Option Compare, can take the values
Binary or Text. If you set Option Com-
pare to
Binary, Visual Basic compares strings using their binary representations. If you set Option Compare
to
Text, Visual Basic compares strings using a case-insensitive method that depends on your computer’s
localization settings. Option Compare Binary is faster, but may not always produce the result you want.
Figure 1-16: The Projects and Solutions folder’s VB Defaults page lets you
set default values for Option Explicit and Option Strict.
Build
The Build menu, shown in Figure 1-17, contains commands that let you compile projects within a solution.
Following is a description of commands associated with the Build menu:
❑ Build WindowsApplication1 — This command compiles the currently selected project, in this
case the project
WindowsApplication1. Visual Studio examines the project’s files to see if any
have changed since the last time it compiled the project. If any of the files have changed, Visual
Studio recompiles those files to update the result.
21
Chapter 1: IDE
37055c016.qxd 4/8/07 12:46 PM Page 21