Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Closing all Running forms
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00278293
Message ID:
00278337
Vues:
17
>Hi Sylvain,
>
>This came up the other day in the ExamStudyGroup in the wiki. The problem is FOR EACH walks through the collection 1 form at a time. As each object is destroyed, the remaining objects move up 1 place in the collection. When it gets half way through the collection all the forms in the last half are now in the front half (I think the effect is that it skips every other one).
>
>I think Craig pointed it out, Mike came up with the solution, I didn't believe it, Nancy tested it, and then Nancy hit me with a fish. :)
>
>Better would be:
>
>** Note we will use nFormIndex to move ahead in the collection
>** if a form can't be relased.
>nFormIndex = 1
>For x = 1 to _screen.FormCount
> oForm = _screen.Forms[ nFormIndex ]
> IF oForm.QueryUnload()
> oForm.Release()
> else
> nFormIndex = nFormIndex + 1
> ENDIF
>endfor
>
>Hope this helps.
>
>>
FOR EACH oForm IN _Screen.Forms
>>   IF oForm.QueryUnload()
>>      oForm.Release()
>>   ENDIF
>>ENDFOR
HTH
>Can someone tell me how to close all the running form in the app. enviroment.


Thanks for your help Guys!!!!!!!!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform