I am trying to figure out if this is a bug or not. This is a watered down
version of something I am trying to do:
C_OBJECT($oParentObject;$oChildObject)
$oChildObject:=New object
$oParentObject:=New object
$oParentObject.ChildInformation:=$oChildObject
$oParentObject.ChildInformation.FirstName:="John"
$oParentObject.ChildInformation.LastName:="Smith"
I want $oChildObject and $oParentObject.ChildInformation to remain the same and
should because of how the references work, so at this moment each are
{FirstName:John,LastName:Smith}. Let say something happens like maybe there is
a Clear button, how would one clear the child object?
First, I wanted to do this:
$oParentObject.ChildInformation:=Null // $oChildObject =
{FirstName:John,LastName:Smith}
Okay, I thought that was the correct way to clear both objects but maybe there
is a different way so maybe this?
OB SET($oParentObject;"ChildInformation";New object) //
$oChildObject = {FirstName:John,LastName:Smith}
Nope, again the child object with $oParentObject is cleared but $oChildObject
remains {FirstName:John,LastName:Smith}. So do I really have to loop over all
properties and remove them individually?
OB REMOVE($oParentObject.ChildInformation;"FirstName")
OB REMOVE($oParentObject.ChildInformation;"LastName") //
$oChildObject = {}
Finally when I make a change in the $oParentObject.ChildInformation the
referenced object $oChildObject is also updated.
Is this a bug? Shouldn't the :=Null work and also change the $oChildObject
variable?
Thanks,
Drew
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************