Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get an object number ?
Message
 
 
À
20/04/2000 05:39:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00361187
Message ID:
00361779
Vues:
17
< snipped >
>Above all Thanks to everybody for replying.
>Anyway what i was trying to do is to increment (add 1) to a counter related to a specific form...trying to explain better : there is a property of a form (errcount) which should be incrementated (?) if an error occurs. I put an on error do errprocname in the init of the form...
>I tried to put the following instrutions in the procedure :
>
>with _screen.activeform
> .errcount = .errcount + 1
>endwith
>
>but it gives me an error...it works fne if i use the form index of the callingform. The point is that i get the number identifying the form
>in the init event of the form, but i think it could change if i open or close
>other forms or objects ...Maybe it would be better to refer the form by its name as said someone of u.

A better way to do this may be to use the form's Error event. When an error occurs in your form, if there is code in the Error event, it will take precedence over any On Error. You can have code in it to call your global error handler with the error information plus an object reference to the form that caused te error. Using the reference you can gather any information you want about the form.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform