>>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.