Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check to see if a file is open
Message
 
To
09/05/2007 16:36:10
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01223969
Message ID:
01224010
Views:
16
Hilmar,

>Note 1: This part gets a little more complicated if you already have a previous ON ERROR, which you must restore in this case

But not that much, right?
local llError, lcError

* Adding following line along with lcError declaration
lcError = ON("Error")
on error llError = .T.

* The following is the line (or lines) that could cause an error
use MyTable

* Adding following line
on error &lcError

if llError
  MessageBox("The file could not be opened; please try again later.")
  * Or do some more detailed analysis, e.g. with aerror()
else
  * Go ahead, and do whatever you would with the table
endif
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Reply
Map
View

Click here to load this message in the networking platform