Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning an Array from a Function
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00338850
Message ID:
00339922
Views:
24
>>I don't think you do. There are languages that permit you to pass an object by value; this means that the receiving function/method gets the address of a copy of the object, as opposed to the address of the copy of an object pointer value. The object passed by value in this case would have a lifespan of the parameter's validity, as opposed to an object reference passed by value as is the case with VFP pass by value, as opposed to the address of the object pointer, the case of VFP's pass by reference. And you absolutely need to understand this difference, since it's an important concept for little unimportant issues like COM!
>
>Ed, that is a very unclear way of explaining something. Normally, showing different cases and the details of that case would be more effective. Regardless, why even talk about passing by value when it isn't done in VFP with objects? You either pass a pointer, or a pointer to a pointer. Right?
>

Let's examine this in the context of COM marshalling. What is actually passed to a remote server, and what behavior occurs when the value passed to the method is passed by reference vs passed by value? Because of marshalling, the "pointer" is never passed directly, is it?

>Anyways, this is not the original point. You said "To actually pass an object by value, you'd have to create a copy of the object in the calling code and destroy the created object copy on return." If you are creating the copy and then working with that copy, you are not really passing by value. You are passing by reference to the COPY. So sure, you can manipulate and change the COPY without changing the original object. But you are only simulating passing the original by value, you are not actually doing it. But your meaning is understood.

Answer the following. If I pass a char memvar by reference, what is passed? If I pass a char memvar by value, what is passed? Realize that the recieving code doesn't know, and doesn't care, if a byref or byval occurred. It receives the same thing in both cases, a parameter of unspecified type and context...
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform