Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find a flaw in the logic
Message
From
13/01/2006 11:27:24
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
13/01/2006 10:58:19
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01086027
Message ID:
01086573
Views:
20
>>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform