emaduddeen
Programmer
Hi Everyone,
In this procedure I have a "try" / "catch" statement. Is it possible to not execute the "next" statement if there is an error?
Here's my code. It's based on a lesson from the MS Press "Step by Step" book. I just wanted to add some extra code to it:
I'm looking to stop the "next" statement from executing after the message box is displayed.
Thanks.
Truly,
Emad
In this procedure I have a "try" / "catch" statement. Is it possible to not execute the "next" statement if there is an error?
Here's my code. It's based on a lesson from the MS Press "Step by Step" book. I just wanted to add some extra code to it:
Code:
Private Sub btnEnterTemps_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnEnterTemps.Click
Dim Prompt As String
Dim Title As String
Prompt = "Enter today's high temperature."
' Load the temperatures into an array.
'-------------------------------------
For TheLoopIndex = 0 To UBound(Temperatures)
Title = "Day " & (TheLoopIndex + 1)
Try
Temperatures(TheLoopIndex) = InputBox(Prompt, Title)
Catch
MsgBox("Please enter a number.", , "OOOPPPSSS!!!!!")
End Try
Next
End Sub
I'm looking to stop the "next" statement from executing after the message box is displayed.
Thanks.
Truly,
Emad