Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Forms Existance
Message
 
À
26/11/2008 14:05:36
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01364242
Message ID:
01364263
Vues:
24
>>>Hi Gang....
>>>
>>>When you have released a form, and you want code later to check to see if this form is still in existance (not instantiated anymore), what do you do?
>>>
>>>I remember something in Tastrade code that used to check for this... first checking for see what the Type of the Object is, then something about NULL....
>>>
>>>What was that???
>>>
>>>Or what do you do??
>>>
>>>Thanks!
>>
>>
>>FOR EACH oForm IN _screen.Forms
>>    IF oForm.Name == "SOMETHING"
>>       *** Then your form exists :-)
>>    ENDIF
>>NEXT
>>
>
>I'm not sure the name of a form would be what you expect it at all times. First off, it's equal to the class name until its .init() exits; then it gets a number appended, which is usually 1 (for the first instance) but not necessarily so (other instances, code setting the form's name). I'd rather check for class, though - assuming the forms were class based; if not, there should be a function. SCX() maybe?

That is just an example of how to find if some form exists.
Instead of Name we could use Caption or other property to distinct form.
I often use one form for more than one purpose depending of parameter I passed to it, so the SCX name is not an option (for me :-)) I always set the name to some distinct values (again this is only me). So I am not sure WHAT makes the form different than the same form but called with different parameter.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform