Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ON SHUTDOWN situation
Message
De
19/10/1997 02:09:38
 
 
À
18/10/1997 23:35:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00055289
Message ID:
00055338
Vues:
29
>>when I have 2 depending forms I always instantiate the "son" as a property of the parent form
>>thus closing the parent form also closes the child form (as it goes out of scope)
>
>Any special recommendations in order to make sure the parent will be closed first? I am using something like this right now which is mostly to scan all the forms and taking action on them.
>
>FOR lnCompteur=lnFormCount TO 1 STEP -1
>   * We don't do the release for a toolbar or a memo
>   IF UPPER(_screen.Forms(lnCompteur).BaseClass)='FORM'
>      IF _screen.Forms(lnCompteur).QueryUnload()
>         _screen.Forms(lnCompteur).Release()
>      ENDIF
>      ELSE

Take a second look to this ELSE branch: if lnCompteur = 1, the FOR loop will be exit anyway and is almost sure you don't want to modify the FOR variable (lnCompteur) here (one value will be skiped without beeing tested).

>      IF lnCompteur=1
>         EXIT
>         ELSE
>         lnCompteur=lnCompteur-1
>      ENDIF
>   ENDIF
>NEXT
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform