Cause compiler error when Option Strict On : Option Explicit « Language Basics « VB.Net Tutorial






Module Module1
    
  Sub Main()

    Dim AnInt As Integer = 5
    Dim ALong As Long = 7

    ALong = AnInt
    'causes compiler error when Option Strict On
    'AnInt = ALong
    MsgBox(AnInt)

  End Sub

End Module








1.8.Option Explicit
1.8.1.Cause compiler error when Option Strict On
1.8.2.Option Explicit Off
1.8.3.Turn Explicit off to use variable without declaration