Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form's problem
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00216559
Message ID:
00216995
Vues:
28
This message has been marked as the solution to the initial question of the thread.
Nadya,

I see Fred got you an answer. Another way of dealing with the issue is to work backwards through the collection:
for i = _screen.FormsCount to 1 step -1
   if ( _screen.Forms[i].Name != thisform.Name )
      if ( _screen.Forms[i].QueryUnload() )
         _screen.Forms[i].Release()
      endif
   endif
endfor
>Hi David,
>
>>Nadya,
>>
>>In your Main.Release() method you can iterate through the _screen.Form[] collection and call _screen.Form[i].Release() for all the other forms. You don't want to try to Release() the main form because you'll infinite loop.
>
> I've tried this before and I still have a problem here. I wrote this code in RELEASE() method of the main form:
>
>if used("tregion")
> use in tregion
>endif
>= tableupdate(.t., .t., "BldMstr")
>
>FOR i=1 TO _SCREEN.FormCount
> =MESSAGEBOX(_screen.forms(i).name)
> IF (UPPER(_SCREEN.FORMS(i).NAME)<>"ZIPS") && ZIPS is the name for the main form
> _SCREEN.FORMS(i).RELEASE()
> ENDIF
>ENDFOR
>DODEFAULT()
>
> After running this code I have an error message: "FORMS is not an object". Then I can not quit from my form and only one way to quit - quit from the FoxPro.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform