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:
00285066
Vues:
21
>Hi George,
>
>I would rethink this if I were you, what happens when QueryUnload returns .F., then you continue on all honkey dorey. This is what I might do:
>
>
local llFailed
>for lnX = 1 to _screen.FormCount
>   if !_screen.Forms(lnX).QueryUnload()
>      llFailed = .T.
>      EXIT
>   endif
>endfor
>
If !llFailed then close down your forms. This is like a transaction type deal, if one of the forms can't close, none will.

Hi Mike,

First, you've fallen into the trap of starting at 1 and trying to go upward. Won't work.

Second, you're right about this oversight. However, note that it will close all the forms where QueryUnload doesn't fail. In other words, it won't blow up. Better might be to add a second variable (logical) as part of the DO WHILE and, if desired use it as a terminating condition for the loop.
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