Forum Discussion
mst1
12 years agoOccasional Contributor
Hello Phil,
Thanks for the reply.
That is a solution, but it give me another problem.
In my previous example, I raised the error in the same file as where I did the ErrorChecker call, so the reference to the Err object is the reference to the original Err object.
But in fact, my error is raised in another file as well.
In FileA, I call a function, located in FileC. There is an error raised in FileC, and this error will also be raised in FileA, because in FileA whas the function caller located.
Now in File A I will call my error checker (which is located in FileB) with the reference to the "local" error object. This is the error object of FileA.
The error checker will handle the Error perfect, and will clear the Error from FileA as well.
But the very first Err source (raised in FileC) is still not cleared.
The example code of File A:
On Error Resume Next
MyFunction 'Calling function located in FileC
'Error raised in FileC
'Because "I" am The caller, The error is raised in THIS file as well (FileA)
ErrorChecker Err 'call the errorchecker with reference to the error object of THIS file (fileA)
On Error GoTo 0
'Now the error of THIS file is cleared, but the error in FileC still exsist
Thanks for the reply.
That is a solution, but it give me another problem.
In my previous example, I raised the error in the same file as where I did the ErrorChecker call, so the reference to the Err object is the reference to the original Err object.
But in fact, my error is raised in another file as well.
In FileA, I call a function, located in FileC. There is an error raised in FileC, and this error will also be raised in FileA, because in FileA whas the function caller located.
Now in File A I will call my error checker (which is located in FileB) with the reference to the "local" error object. This is the error object of FileA.
The error checker will handle the Error perfect, and will clear the Error from FileA as well.
But the very first Err source (raised in FileC) is still not cleared.
The example code of File A:
On Error Resume Next
MyFunction 'Calling function located in FileC
'Error raised in FileC
'Because "I" am The caller, The error is raised in THIS file as well (FileA)
ErrorChecker Err 'call the errorchecker with reference to the error object of THIS file (fileA)
On Error GoTo 0
'Now the error of THIS file is cleared, but the error in FileC still exsist