Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File in use
Message
From
01/08/2003 07:58:19
 
 
To
31/07/2003 14:08:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00815491
Message ID:
00815802
Views:
13
Whoops!! The last line before 'return' resetting the On Error command should also be inside the if clause before the 'Resume next' statement.

Alan

>>i want to know if they exist another solution because i have a lot to change like this
>
>About the only way I can think of so you don't have to change all your "USE" statments would be to use an ON ERROR statement passing the error() and message() parameters. If Error() is 24, you could parse out the < name > from Message() and then do the same sort of code - ie - just do the select.
>
>
On Error do CatchError with Error(), Message(), Message(1), Program(), LineNo()
>
>Procedure CatchError(tnErrorNo, tcMessage, tcMessage1, tcProgram, tnLineNo
>Local lcOnError, lcAlias
>
>   lcOnError = On("Error")
>   ON ERROR
>
>   If tnErrorNo = 24
>      Alltrim(lcAlias) = Substr(tcMessage, 1, At(" ", Message()))
>      Select (lcAlias)
>      Resume Next
>   endif
>
>   ** other error code for other errors
>   ** ditto ditto
>
>   On Error &lcOnError
>
>Return
>
>
>It might work ;)
>
>Alan
Previous
Reply
Map
View

Click here to load this message in the networking platform