Go4Expert (http://www.go4expert.com/)
-   Visual Basic [VB] (http://www.go4expert.com/articles/visual-basic-tutorials/)
-   -   Option statments in VB.NET (http://www.go4expert.com/articles/option-statments-vbnet-t3799/)

pradeep 8Apr2007 23:56

Option statements in VB.NET
If you want to properly utilize VB.NET, it is very important to understand option statements. The following is a quick overview of the three option statements that are supported in VB.NET:
  • Option Explicit: By default, Option Explicit is on for VB.NET projects. It's a good programming practice to set Option Explicit on because it helps developers avoid implicitly declaring variables, and thus write better code. This forces developers to explicitly declare variables utilizing the Dim keyword and specifying the data type for the variable.

  • Option Compare: By default, the Option Compare is Binary; however, you can set Option Compare to Text instead.

  • Option Strict: Option Strict Off is the default mode for the code in VB.NET; however, it's preferable to write code with Option Strict on. Option Strict On prevents implicit type conversions by the compiler. It's also a safer way to develop code, which is why most developers prefer it.
Note: Option Base, which allows you to specify the base of the declared arrays, is supported in VB6 but not in VB.NET.

bhavin73 24Jun2008 17:04

Re: Option statments in VB.NET
See some more about Option Explicit and Option Strict with source code





shabbir 24Jun2008 19:16

Re: Option statments in VB.NET
Offtopic comment:
Is this your site?

All times are GMT +5.5. The time now is 03:13.