Hey all, I'm new to this site, and after looking around a couple days, haven't found the answer I was looking for, so maybe y'all can answer my question.
I'm working on a lab (array manipulation exercise) that seeks to receive 10 values through an InputBox, display them, (also providing options for getting the average, and sorting the values). My problem is that I am not exactly sure how to validate that the user enters correct data, and the main thing is that it keeps coming up with an error whenever the cancel button is clicked.
Here is my code, if y'all can help at all, I would greatly appreciate it... the lab's due on Sunday, but I've never not finished a program, so even if it's past Sunday, I would still like to know what I did wrong
CODE
Dim intCounter As Integer
Dim msgInput As DialogResult
Dim strArray As String
Try
For intCounter = 0 To 9
strInputVal = InputBox("Please enter a value:" & vbNewLine & "Remaining values to be entered: " & 10 - intCounter, "Input")
If IsNumeric(strInputVal) Then
intValidVal = CInt(strInputVal)
intDigitArray(intCounter) = intValidVal
Else
MsgBox("Error! Non-numeric value!")
End If
If strInputVal = Nothing Then
MsgBox("Please enter a value!")
End If
Next
Catch ex As Exception
MsgBox("AAAAAGGGHHH!!! there seems to be an error. yes. unfortunately. What the error is, I have no bloody clue. Thank you for using another fine vyprTECH product! :)")
End Try
Geekin out in North Pole, Alaska,
- vypr