Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Destroy fires twice
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01450229
Message ID:
01450360
Vues:
59
>>
PROC main_job
>>private poLog
>>poLog = NULL
>>main_job2()
>>poLog = NULL                     && <== here the Destroy() fires again
>>RETURN
>>
>>PROC main_job2
>>     poLog = someobject()
>>     RETURN                     && <== here the Destroy() fires first
>>
>
>Peter,
>
>Not directly related to your problem, but you do not need to use a private variable in this case at all (if you ever need...) your code will be better, IMO if you were just using local variables.

Under normal circumstances I seldomly use private vars (except for what I call global vars, in the main routine). However, in this case I appear to have created various private variables. It is an abstract job processor, fed by metadata. Abstract because it must serve all kinds of jobs. Rather than send huge lists of parameters to jobs and subjobs, I decided to create private variables. The developer who creates a new job can use all kinds of (private) variables. I could have sent them to the job via parameters, but it didn't feel good. Perhaps an array is a good idea.

>
>PROC main_job
>local loLog
>loLog = main_job2()
>RETURN
>
>PROC main_job2
>     local loLog
>     loLog = someobject()
>     RETURN loLog
>
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform