>Thanks for the idea mark, but I cannot issue Retry at that point because then it goes into an infinite loop of retrying:
>
>oMeta.oSDTMgr.Update(oMeta.oSDTMgr.cAlias)
>
>which was not what the original command was, but rather it should be:
>
>oMeta.oSDTMgr.OpenTable(ufile, uorder, uexclu, ualias, .F., usession)
>
>Now this would happen if the ON ERROR called a function instead of a procedure and value could be returned so I have tested that as well. However, when I call a function instead:
>
>ON ERROR ErrorHandler(ERROR(), MESSAGE(), LINENO())
>
>and then it goes tot he ErrorHandler function, the value of ERROR() being passed gets changed to 0 at that point and it should be 1 (in this case). Retry is never passed back (where the dbcxmgr would issue it correctly) because the case statement never gets processed in errorhandler.
>
>If it's not one thing it is another!
The problem you are experiencing is there is no variable for your error handler to be returning a value to when an error occurs. Even though you have:
ON ERROR ErrorHandler(ERROR(), MESSAGE(), LINENO())
when your ErrorHandler finishes its execution and returns a value, there is nowhere for that value to go. About the only thing you can do is have your error handler set the value of a global application property. So when your code detects that property is a certain value, then you can branch off and do whatever you need to do.
goApp.lErrorHappened = .f.
if goApp.lErrorHappened
endif
Mark McCasland
Midlothian, TX USA