Module DemoOnErrorGoto
'Buka DemoOnErrorGoto.vbproj
Sub Main()
On Error GoTo ErrorHandler
Dim a, b, c
'Inisialisasi variabel
a = 1 : b = "Satu"
c = a + b
Debug.Print("Nilai a + b = " & c)
Exit Sub
ErrorHandler:
MsgBox("Salah - Type Mismatch")
Resume Next
End Sub
End Module
Tidak ada komentar:
Posting Komentar