Module Example
Public Sub Main()
Dim numbers() As Long = { Int64.MinValue, -1, 0, 121, 340, Int64.MaxValue }
Dim result As Integer
For Each number As Long In numbers
Try
result = Convert.ToInt32(number)
Console.WriteLine(result)
Catch e As OverflowException
Console.WriteLine("OverflowException")
End Try
Next
End Sub
End Module