Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File in use
Message
From
31/07/2003 14:08:01
 
 
To
31/07/2003 13:42:34
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00815491
Message ID:
00815537
Views:
10
>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
Next
Reply
Map
View

Click here to load this message in the networking platform