I'm trying to get to grips with raising errors appropriately in VB6. What I've got is a class method that will only accept parameters of a certain form
eg.
The working aren't important, but you get the idea. Now, what I want to happen is when the error is raised, for the "Class1.CallMethod 1,2" line to be highlighted, not the "Err.Raise .." line - I want the error to be passed up to the caller, rather than raised in the class.
Can this be done?
Am I missing something obvious?
If anyone could guide me along the right route it would be greatly appreciated!
Cheers,
Dan.
eg.
Code:
Form:
Sub Form1_Load
Set Class1 = New CTestClass
Class1.CallMethod 1, 2
End Sub
Class:
Public Sub CallMethod(Arg1, Arg2)
If Not (ValidArgs(Arg1, Arg2)) Then
Err.Raise ..
Exit Sub
..
End Sub
The working aren't important, but you get the idea. Now, what I want to happen is when the error is raised, for the "Class1.CallMethod 1,2" line to be highlighted, not the "Err.Raise .." line - I want the error to be passed up to the caller, rather than raised in the class.
Can this be done?
Am I missing something obvious?
If anyone could guide me along the right route it would be greatly appreciated!
Cheers,
Dan.