Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to close all forms?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00284684
Message ID:
00284782
Vues:
23
>>Not exactly. The order of a LIFO stack is static only responding to PUSHes and POPs. A good example of a LIFO stack in VFP are menus. The forms collection isn't really a LIFO stack, because the order of it is changed each time a window is activated. The most recently activated form is brought to the top (this excludes toolbars, if present, which will always preceed the forms.
>>
>
>Hi George,
>
>Your right, I was thinking *like* LIFO, but typed something different, doh! When a form is added to the collection is does go in the top, but they do move around in the collection as different forms get activated.
>
>Thanks for pointing that out.
>
>>You're correct about closing them. One should start at the last form in the collection and work upward.
>
>Actually I start at the beginning and release until they are all gone (skipping the toolbars as I go). I didn't realize that the toolbars are always on the top. Do you think there would much difference doing that way, or would it be better to start at the bottom and release until you hit the toolbars and then stop?

Yes, in fact that what I thought you had said (serves me right for not reading more carefully). This eliminates the problem of having the form move "up" in the order. Basically, what I do is something like
lni = _SCREEN.FormCount
DO WHILE lni > 0
  oForm = _SCREEN.Forms(lni)
  IF oForm.BaseClass = 'FORM'
    IF oForm.QueryUnload()
      oForm.Release
    ENDIF
  ENDIF
  lni = lni - 1
ENDDO
I'd say that any additional processing that would be caused by any existing toolbars is so insignificant as to be meaningless.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform