Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can not exit app without error message
Message
De
05/10/1998 16:32:48
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00144008
Message ID:
00144009
Vues:
32
>this is a stupid newbie question. working on my first app. never had to look at the clear, release, etc statements before. now i added some code, and when i try to exit my app there are all sorts of unknown references. what is the normal way to close an app? i do not even know what actually happens (which events are triggered) on a RELEASE.
>
>in my case i have a toplevelform (osdi), with a pageframe. each page contains many containers and grids. these containers and grid use many of the variables and methods in a container that holds public methods and variables (oapp, below).
>
>when i release osdi, should its pageframe, and all its containers and grids be destroyed? seems i end up in the debugger on osdi.page2.grid.valid during the clear all.
>
>CLOSE ALL
>RELEASE oSDI && toplevelform
>RELEASE oApp && container, pulblic methods and variables
>CLEAR ALL
>RELEASE ALL
>
>any info is appreciated.
>
>brenda

There are some basic rules:
1. Normally, you finish application with CLEAR EVENTS. If you use top-level form, you can e.g. add CLEAR EVENTS to TopForm.Unload event.
2. You may add some 'cleaning' code after READ EVENTS, but it will actually matter in development environment only.
3. If some form(s) have properties holding object references, it's safe practise to set all of them to .NULL. in Form.Destroy event.
4. This is not a good practice to have public variables, but they shouldn't harm app exit.
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform