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:
00344096
Views:
32
Again that may be your requirement, but I still say that's bad design. Take a look at any modern dev tool that uses objects especially component based objects and you'll see that every object is a pointer that can't be accessed directly.

Is there uses for passing by value? Yeah, but they're far and between and outweigh any of the downsides that typically occur when you pass by value. If persistence is something you're worried about there are better ways to accomplish that.


+++ Rick ---



>I have to disagree. There's always a need to pass an object by value when you want to be sure that the
>called function will not modify the original object. Otherwise, the constness of the param object cannot be assured.
>
>Another case when this is necessary is when you're using classes that you cannot change. So, good or bad design,
>they cannot be changed and you need pass by value... which is not possible in VFP.
>
>Vlad
>
>>In general there's no need to ever pass an object by value - if you do, I'd say there's a design problem that can be solved easily by creating data members that can be copied.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform