Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ARGG! VFP send my objects by reference, no by value!!!!
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00342323
Message ID:
00343225
Views:
30
>>Ed, you almost always make the same mistake: You assume that I am missing something. I am not.
>>
>
>You are missing something basic, the mechanism to pass the pointer to the copy of the object is absolutely immaterial, because the copy has no life relative to the caller unless the called function/method does something to perpetuate it, and under no circumstance does it populate back to the original object. The distinction between case 1 and case 2 is the perpetuation of manipulations of the pointer within the context of the called code populating back to the caller.
>
>I'd rather stop wasting time and space on this, because you don't understand the concepts of copy and value.

Ed, you are exactly right. This is a waste of time and space. You completely ignore the fact that I said "I am not addressing case 1." You have your own point that you want to discuss. But what you have just stated is just a recap. Why go over it again and again?

Here Ed: You can change the value of every property of the "copy of the object". No matter what you do to the "copy of the object," the original object will not change. Of course, this is irrelevant to the point I made. You know what, we've had real nice weather up here lately. I have a painting of three bears on my wall. Today is Wednesday.

"I am not addressing case 1." "I am not addressing case 1." "I am not addressing case 1."

Get it?

Simple point Ed. Case 3 is using case 2 to SIMULATE passing an object by value. No object is being passed by value. A object reference is being passed by value. The object reference just happens to point to a duplicate of the original object.

Why try to expand this conversation past that?

Joe

>>You also almost always expand a point into unnecessary areas. We are talking strictly about case 2 and case 3. Why do you start to mention case 1? Please don't answer. Honestly, I am addressing specifically what I chose to address. It has nothing to do with case 1. It is related. But I am being very direct here. I am not addressing case 1.
>>
>>It is a simple point that you are missing. Try not to think of anything else but one simple point. Case 3 is using case 2 in its second line (you've agreed). So, case 3 is actually using an object ref passed by val (case 2) in its call to MyFunc(). But it is first creating a copy of the object (new object, new pointer; entirely new entity). So, case 3 is "simulating" passing an object by value. The actual pass to the function is an object reference passed by value (i.e. case 2).
>>
>>Can we just address that? If you want to expand into other areas, lets do that later. Lets settle this first.
>>
>>>>>>Please answer this question with a Yes or No.
>>>>>>>>>An object ref passed by ref ...MyFunc(@oObjeRef)
>>>>>>>>>An object ref passed by val ...MyFunc(oObjeRef)
>>>>>>>>>An object passed by val........oNewObj = (code to duplicate oObjeRef as a new instance)
>>>>>>>>>...............................MyFunc(oNewObj)
>>>>>>>>>...............................oNewObj = NULL

>>>>>>
>>>>>>
>>>>>>>>Can I just get one bit of satisfaction? Will you agree that case 3 (An object passed by val) is actually using case 2 (An object ref passed by val) combined with the object-duplicator function to "simulate" passing the original object by value.
>>>>>>>>
>>>>>>>
>>>>>>>They are not the same! (2) If you change the object content of the passed object reference, the original object's content is changed. If you reassign the parameter received, the context of the original object reference is not altered.
>>>>>>>
>>>>>>>(3) If you change the copied object's content, the original object's content that was duplicated is not altered. If you reassign the parameter received, the context of the original object reference is not altered. And the reassignment does not affect the assignment of the object reference oNewObj in the caller. If an object reference is assigned elsewhere based on oNewObj, the object oNewObj continues its existance disjoint from oObjeRef.
>>>>>>>
>>>>>>>(1) Any alteration to either the object content or the object reference passed by reference directly affects the original object reference, to the point that the object may die of starvation if the reference is reassigned.
>>>>>>>
>>>>>>>>And I refuse to let this start an argument. I am complimenting you.
>>>>>>>>
>>>>>>>>Joe
Joseph C. Kempel
Systems Analyst/Programmer
JNC
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform