Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find a flaw in the logic
Message
De
13/01/2006 15:26:09
 
 
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:
01086686
Vues:
25
Frank,

I think we do not disagree at all. I always deliberately write 'object reference variable', thus making clear that an O-type variable is always merely a reference to the object, not the object itself.

I already explained to Dragan that he kind of mixed up me and Naomi when he started to talk about object referencing. When you go back in the thread, you will see that I pointed out to Naomi that it is, normally speaking, better not to change the value of a passed variable. This is also true for variables that refer to an object.

>Pater,
>
>>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
>
>The memvar oForm was passed by value (copy of), but it's a reference (address of) to an object otherwise we could not change the properties of the underlying object. When that code set the memvar to null it was only affecting the local stack copy of the memvar oForm, not the real oForm memvar.
>
>>while the second run is indeed a pass by reference.
>
>The address of the memvar oForm was passed to the routine, it still references (holds the address of) the real form object so we can change the form's caption. But now when the loObject was set to .null. we are actually changing the oForm memvar, which decrements the reference counter of the form object to 0 which makes the form destruct.
>
>>So, apparently objects (no, better: object references) are not always passed by reference, but can also be passed by value. Is this confusing?
>
>The way you state it above is not correct.
>
>You always have an object by reference. We really don't have a native way to pass object copies around in VFP like can be done in other languages.
>
>The memvars that hold an object reference may be passed by value or by reference.
>
>>>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:
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