Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Handling Errors 1977 &/or 110
Message
De
19/11/1999 22:02:04
 
 
À
19/11/1999 21:55:15
Porter Hart
Raytheon Systems Company
El Segundo, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00293385
Message ID:
00293386
Vues:
31
>I've a multi-user app on which one user occasionally needs exclusive use of one table. If another user has that table open, the exclusive open fails with a 1977 error. So how can user A tell whether user B has that table open--without shouting across the room?
>
>If the above circumstance cannot be detected, could anyone offer a production-quality routine to trap the resulting error? To date, I've received only error 1977, but the message for 110 also sounds possible.
>
>An FPW26-based solution would also be of interest.
>
>TIA
>Porter Hart

The primitive trap is simple enough:
lErrorflag=.f.
cError=on('error')
on error lErrorflag=.t.
*** run your command here
on error &cError.
If lErrorflag=.t.
=messagebox('You got an error!')
*** do something here, you may use ERROR() function to show/analyze error number
Endif

The more sophisticated way is to put some code (e.g. to check error number) to object.error event (this event will be triggered when error happens within this object's event/methods).
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform