Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check to see if a file is open
Message
 
À
09/05/2007 16:36:10
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01223969
Message ID:
01224010
Vues:
17
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform