Option Strict.


VB.NET Forum Moderator
Staff member
Jun 3, 2004
Lansing, MI; USA
Programming Experience
in vb.net there are two compiler options you should turn ON
Option Explicit and Option Strict

Option Explicit On means that all variables that you use have to to be declared first, if you don't declare them you get a compile error. make sure it's ON

Option Strict On means that vb wont auto convert variable type ie DecAmount = intAmount instead you have to convert it intAmount = Convert.ToDecimal(intAmount) you're program will run faster if you convert the types yourself, option strict forces type conversion. for type conversion there is also the CType function as well.

Latest posts

Top Bottom