Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find a flaw in the logic
Message
De
13/01/2006 11:37:52
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
13/01/2006 11:01:44
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:
01086580
Vues:
21
>>You can check this yourself - pass thisform by value to any piece of code which will change its caption and see what happens.
>
>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

Yes, I ran that code. My point is that it would still operate on Checkbox2, it wouldn't be creating a copy of the checkbox, which would vanish when your code exits (as it happens with variables passed by value).

Again, we're talking about two separate things: my point is that an object variable is a reference to the actual object, regardless of whether it's passed by reference or by value. It doesn't create a copy of the object, it only creates a copy of the reference variable.

And your point, as I understand it, is that such a variable, if passed by reference, can be messed with, be made to point to a different object (as your example shows), be dereferenced etc. Which is also true - but that doesn't do anything to the object the variable referenced in the first place. Did anything happen to checkbox1 in your example?

And I agree about your initial remark to Nadya, there is a potential danger that the object passed may be re-referenced if passed by reference. Though, I've done pretty much the same thing as she did in my recurse class and never had a problem, probably because I didn't need to reuse the object passed after the recursion routine exits.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform