General information
Category:
Coding, syntax & commands
John, that is a very interesting problem. There are different means of solving it. I do something very similar to you in my system for this purpose.
I have a method for called 'CheckExclusive' in my application object. In that method I first switch the error handler from my normal error handler to a special error handler used only here and that method is called 'ErrorExclusive'.
ON ERROR =oPM.ErrorExclusive()
Then when I cycle through the tables and USE each one of them in EXCLUSIVE mode the special error handler is triggered if one of them won't load. In that special error handler I do only one thing. I record the Error # in a property of that application object.
oPM.ErrorNumber=ERROR()
Then back in the CheckExclusive method after the USE statement I check to see what the error number was or if the table simply didn't load
and then I know it's not exclusive. At the end of the loop I can tell user to fix it.
IF oPM.ErrorNumber=3 OR NOT USED(lcTable)
oPM.ExclusiveOK=.F.
lnHowMany=lnHowMany+1
ENDIF
Simply storing that error number or failure status in a property of a non-visual custom object rather than a variable will solve your problem.
Wally Noll
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only