Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find a flaw in the logic
Message
De
13/01/2006 11:27:24
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
13/01/2006 10:58:19
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:
01086573
Vues:
21
>>This is true for any variable - but what is a content of an object reference variable? The reference to an object. And even if you have a copy of such a variable (i.e. passed by value), it only increases the reference count in the object, it doesn't create a copy of the object.
>
>>So, substantially, an object passed as a parameter is always passed by reference. Or, more precisely, it's passed as a reference.
>
>I don't agree.
>This creates only confusion.
>
>With this logic,
>- when you pass a integer variable by value, and the value is a array's index
>you pass a reference to the array element !
>- when you pass a string name="someCursor" by value,
>you pass a reference to the cursor !
>
>- when you pass a string name="Dragan Nedeljkovich" by value,
>you pass a reference to You !
>....

That's more the semantic - what content does the variable hold, and how will it be used. Even if you pass my name, it may be used only to calculate the number of characters in it, or it may be used to send me a letter. It's still just a character variable, and whatever you may do to it, doesn't affect me directly.

The integer variable may be an index into an array, but it may also be used in calculation. However, with an object reference variable, there's nothing else you can do with it but to use it as an object variable or dereference it.

>The difference is simple:
>- by reference : VFP copy the variable metadata value
>- by value : VFP copy the variable data value

This is a very good description, I like that.

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
Répondre
Fil
Voir

Click here to load this message in the networking platform