Thanks Cannon,
So maybe I want to use OB Copy when I load the record in an input form.
That way I can make changes to the object without changing the object in the
field. That way if the user cancels I don’t have to worry about the field.
When the user saves the record, should I use OB Copy to save the object
back to the field, or does it really matter?
John
On June 12, 2018 at 3:14:33 PM, Cannon Smith via 4D_Tech ([email protected])
wrote:
> [Letter Templates]WP_SeriesPictures:=oPictures
Both [Letter Templates]WP_SeriesPictures and oPictures point to the same
C_Object instance in memory. If you change either one, they are “both” changed.
> [Letter Templates]WP_SeriesPictures:=OB Copy(oPictures)
[Letter Templates]WP_SeriesPictures and oPictures now point to completely
separate C_Object instances in memory. If you change one, the other is
unaffected.
A deep copy means that if the object being copied has child objects (and
grandchildren, etc.), they are all copied as well. It is then safe to modify
any level of object knowing you won’t modify the original object.
--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236
<[email protected]>
<www.synergyfarmsolutions.com>
> On Jun 12, 2018, at 7:08 PM, johnbdhPop via 4D_Tech <[email protected]>
> wrote:
>
> What is the difference between the following...
>
> [Letter Templates]WP_SeriesPictures:=oPictures
> [Letter Templates]WP_SeriesPictures:=OB Copy(oPictures)
>
>
> Both work. The LRM for OB Copy speaks to “a complete (deep) copy of the
> properties”. What does “deep” mean.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************