Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
On error-lineno()
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00227975
Message ID:
00227984
Views:
24
>>You need to pass the LINENO() in your on error call. As in:
>>
>>ON ERROR DO CatchErr WITH ERROR(), MESSAGE(), LINENO(), PROGRAM()
>>
>>>I am trying to catch errors using
>>>on error do catcherr where catcherr.prg contains:
>>>"str(ERROR( ))+MESSAGE( )+str(LINENO( ))+pROGRAM( )"
>>>
>>>but the lineno() reports back the lineno of catcherr, not where the error actually happens!
>
>Josh, I may not have conveyed too well but I did that.

Timothy,

Could you post some code from catcherr.prg. Basically, it should look something like this:
ON ERROR DO CatchErr WITH ERROR(), MESSAGE(), LINENO(), PROGRAM()

* CatchErr.prg
LPARAMETERS lnError, lcMessage, lnLineNo, lcProgram
?lnError, lcMessage, lnLineNo, lcProgram
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform