Академический Документы
Профессиональный Документы
Культура Документы
Example 1
On Error GoTo first Dim x, y, z As Integer x = InputBox("enter the number ", "ssi", 0) y = InputBox("enter the second number ", "ssi", 1) z = x / y MessageBox.Show(" answer is " & z, "ssi", MessageBoxButtons.OK, MessageBoxIcon.Hand) Exit Sub first: MsgBox(Err.Description)
Example 2
On Error GoTo 0 Dim x, y, z As Integer x = InputBox("enter the number ", "ssi", 0) y = InputBox("enter the second number ", "ssi", 1) z = x / y MessageBox.Show(" answer is " & z, "ssi", MessageBoxButtons.OK, MessageBoxIcon.Hand) Exit Sub first: MsgBox(Err.Description)
Example 3
On Error Resume Next Dim x, y, z As Integer x = InputBox("enter the number ", "ssi", 0)
y = InputBox("enter the second number ", "ssi", 1) z = x / y MessageBox.Show(" answer is " & z, "ssi", MessageBoxButtons.OK, MessageBoxIcon.Hand)
Example 4
Try Dim x, y, z As Integer x = InputBox("enter the number ", "ssi", 0) y = InputBox("enter the second number ", "ssi", 1) z = x / y MessageBox.Show(" answer is " & z, "ssi", MessageBoxButtons.OK, MessageBoxIcon.Hand) Catch ex As Exception MsgBox(ex.ToString) End Try