Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ON SHUTDOWN situation
Message
From
19/10/1997 02:09:38
 
 
To
18/10/1997 23:35:32
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00055289
Message ID:
00055338
Views:
24
>>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
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform