Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What basis is used?
Message
 
À
25/12/1999 22:08:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00308584
Message ID:
00308586
Vues:
20
>Hi,
> I would like to know what basis is used in VFP for form when form released. IOW, if there are 3 forms load in sequence - form1, form2 and form3, if try to release form as the following, which form will be activated?
>
>
>FormReleased       FormActivated?
>   Form1                ?
>   Form2                ?
>   Form3                ?
>
>How about some of them were minimized in that time?
>

John,

There is really no way to answer your question. A form is an object, an object has a reference to it somewhere. If you call the release method of an object that object will release itself. If you RELEASE ObjectReference the Object reference is released adn if that is the one and only referecen to a paricular object the then object is also released.

IOW, you ned to know more about your 3 forms other than the order in which they were created. What are the object reference names to those forms? (The object refrence is NOT the same thing as the contents of the Name property nor is it exactly the saem thing as the name of the window the fomr is in).

If you create the forms like this;
Form1 = CReateObject("Form")
Form2 = CreateObject("Form")
Form3 = CreateObject("Form")
then releasing Form2 will release the second form you created as the object reference to the second form is Form2.

If you create the forms like this;
DO FORM Form1
DO FORM Form2
DO FORM Form3
Tehn releasing Form2 may not do anything but cause an error. You ahve not explicitly named the object references and VFP will give them names. Usually the name for the object reference will be the same as the name of the scx that the form is created from, but not always. Depending on VFP to name your object references is a poor design approach. You shoyuld always explicitly name your object references so you know for sure what those reference names are.

The DO FORM commadn gives you a way to do that;
DO FORM Form1 NAME Form1
DO FORM Form2 NAME Form2
DO FORM Form3 NAME Form3
The only problem here is that if there is a form named Form2 when the second line is executed the existing form named Form2 will be destroyed and a new form will take its place.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform