|
-
Jun 7th, 2000, 12:52 AM
#1
Thread Starter
Addicted Member
Im trying to make a error
handler for my program for
a overflow, err.number 6
Can someone tell me why this
doesnt work?
Code:
Public Number As Integer
Private Sub Form_Load()
ErrorTrapper
End Sub
Private Sub ErrorTrapper()
On Error GoTo ErrorHandler ' Enable error-handling routine.
Number = 2.21222222222222E+27
Exit Sub ' Exit to avoid handler.
ErrorHandler: ' Error-handling routine.
Select Case Err.Number ' Evaluate error number.
Case 6 ' "Res Index not there" error.
Exit Sub
End Select
End Sub
-
Jun 7th, 2000, 12:58 AM
#2
transcendental analytic
First the error occurred as your integer can't support that large number (2^15-1 is the highest)
Second your errorhandler don't work because you have err.number
Use only err
Third you should use a resume statement to get back from your procedure
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 7th, 2000, 01:07 AM
#3
Thread Starter
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|