Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find a flaw in the logic
Message
De
13/01/2006 12:43:20
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01086027
Message ID:
01086622
Vues:
23
As I read it (and I did run the code), the first run does not remove the form, indicating that it is a pass by VALUE while the second run is indeed a pass by reference. So, apparently objects (no, better: object references) are not always passed by reference, but can also be passed by value. Is this confusing?

>Peter, et al
>
>Objects are always passed by reference. The memvars pointing to them may or may not be passed by reference. A subtle difference:
>
>
>oform = createobject( "form" )
>oform.Visible = .t.
>
>callfunc( oForm, "test" )
>
>callfunc( @oForm, "test2" )
>
>function callfunc( loObject, lcCaption )
>
>loObject.Caption = lcCaption
>set step on
>loObject = .null.
>set step on
>return
>
>
>In both cases we can manipulate the object itself by changing the caption. but the first call does not result in the form disappearing. The second one does because the loObject = .null. line is actually affecting the oForm memvar not the form itself.
>
>>Pass thisform by reference, change its value and see what happens when you use it. See Re: Find a flaw in the logic Thread #1086027 Message #1086509
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform