Module Module1 Sub Main()
On Error GoTo Handler Dim i1 As Integer = 0 Dim i2 As Integer = 128 Dim intResult As Integer
intResult = i2 / i1
Console.WriteLine("Press Enter to continue...")
Console.ReadLine()
Exit Sub
Handler:
Console.WriteLine("An overflow error occurred.")
Resume Next End Sub End Module
An overflow error occurred.
Press Enter to continue...