abangbatax
asked on
trap or catch or locate where is my error code
Hi experts,
I would like to ask how to trap or catch or locate where is my error code,
i have compiled a software but got error on some event, after i check the code i cant find the mistake
this can take a lot of time.
Can you give me solution for this?
Thanks
I would like to ask how to trap or catch or locate where is my error code,
i have compiled a software but got error on some event, after i check the code i cant find the mistake
this can take a lot of time.
Can you give me solution for this?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What development environment are you using? Can you run within the environment so that the builtin debugger shows you where the error is occurring?
If not, abangbatax has given you a good solution - but you don't have to put in every line number to start with. You should be able to tell from the running program approximately where in the code the error is. Try putting in a few MsgBox statements at the start and ends of procdures to narrow it down, then when you find the procedure that's falling over, use the line numbers.
I hope you don't have procedures that have hundreds of lines of code, otherwise you might need to think about rewriting them to be smaller : )
If not, abangbatax has given you a good solution - but you don't have to put in every line number to start with. You should be able to tell from the running program approximately where in the code the error is. Try putting in a few MsgBox statements at the start and ends of procdures to narrow it down, then when you find the procedure that's falling over, use the line numbers.
I hope you don't have procedures that have hundreds of lines of code, otherwise you might need to think about rewriting them to be smaller : )
Also - when using numbers - you do not need to number every line
Just whatever the last number is what is reported
So if you went
100 ......
....
...
... ERROR
....
102 .....
And the error is as above - it will kick back line 100
Just whatever the last number is what is reported
So if you went
100 ......
....
...
... ERROR
....
102 .....
And the error is as above - it will kick back line 100
ASKER
Is this the only way?