> On 1 Dec 2016, at 10:36, Peter Jakobsson <li...@netkelvin.com> wrote:
> 
> I’m only talking about the case where we want to manipulate a variable in the 
> calling method. i.e. the cases when one would normally use a pointer with all 
> other data types. Inthose cases I’m saying it appears more reliable to use a 
> pointer for objects as well and not rely on this “new” behaviour.


Hi Peter,

Thank for clearing this part up. Now let me try to clear up the other part :-)

The only thing to keep in mind is when you pass an undefined object as an 
argument to a project method. Changes you make inside the project method will 
not reflect to the calling method, since it was undefined there.

To solve this you can either use pointers as you suggested. Or you can return 
the initialised object in $0. The last things is what I would recommend. Use it 
like a constructor function. For example:

C_OBJECT($rob;$peter)
$rob:=Person_New(“Rob”;”Laveaux”)
$peter:=Person_New(“Peter”;”Jakobson”)
ALERT(Person_Greet($rob))
ALERT(Person_Greet($peter))

When you keep this in mind, than there is no problem at all passing objects 
around as references.

- Rob Laveaux

--------------------------------------------------------
Pluggers Software
Scholekstersingel 48
2496 MP  Den Haag
The Netherlands

Email: rob.lave...@pluggers.nl <mailto:rob.lave...@pluggers.nl>
Website: http://www.pluggers.nl <http://www.pluggers.nl/>

--------------------------------------------------------



**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to