Export (0) Print
Expand All

6.2 Compilation Options

Visual Studio .NET 2003

A source file can specify compilation options in the source code using option statements. An Option statement applies only to the source file in which it appears, and only one of each type of Option statement may appear in a source file. For example:

Option Strict On
Option Compare Text
Option Strict Off    ' Not allowed, Option Strict is already specified.
Option Compare Text  ' Not allowed, Option Compare is already specified.

There are three compilation options: strict type semantics, explicit declaration semantics, and comparison semantics. If a source file does not include a particular Option statement, then the compilation environment determines which particular set of semantics will be used. There is also a fourth compilation option, integer overflow 0checks, which can only be specified through the compilation environment.

OptionStatement ::=
   OptionExplicitStatement | 
   OptionStrictStatement | 
   OptionCompareStatement

See Also

6.2.1 Option Explicit Statement | 6.2.2 Option Strict Statement | 6.2.3 Option Compare Statement | 6.3 Imports Statement | 6.4 Namespaces | Visual Basic Compiler Options (Visual Basic Language Reference)

Show:
© 2014 Microsoft