Re: Object Arrays - Very Interesting "Watchas"

2016-10-29 Thread Lee Hinde
I haven’t read all the responses, but this is how I’d write this method: ARRAY OBJECT($arrOBJECTS;0) C_OBJECT($myObject) // <— New OB SET($myObject;"myName";"Ian") APPEND TO ARRAY($arrOBJECTS;$myObject) CLEAR VARIABLE($myObject) // <— New OB SET($myObject;"myName";"Sandra") APPEND TO ARRAY($a

Re: Object Arrays - Very Interesting "Watchas"

2016-10-29 Thread Kirk Brooks
Peter, On Sat, Oct 29, 2016 at 4:28 AM, Peter Jakobsson wrote: > On the other hand, if I do this… > === CODE BLOCK 2 > > ARRAY OBJECT($arrOBJECTS;0) > > $myObject=JSON Parse("{}”) (Create an empty object) > > OB SET($myObject ;"myName”;”Ian”) > APPEND TO ARR

Re: Object Arrays - Very Interesting "Watchas"

2016-10-29 Thread Peter Jakobsson
Hi Bernard Yes indeed - I saw his component last year and thought it was an excellent piece of work. Good description of the behaviours also. Peter On 29 Oct 2016, at 23:31, Bernard Escaich wrote: > Cannon Smith has written a component OBJ_Module, free for the community. > It's amazingly usef

Re: Object Arrays - Very Interesting "Watchas"

2016-10-29 Thread Bernard Escaich
Hi Peter, Cannon Smith has written a component OBJ_Module, free for the community. It's amazingly useful ! I have selected this from read me that explains the behavior you have seen //-- // Reference Counting vs Copying //---

Re: Object Arrays - Very Interesting "Watchas"

2016-10-29 Thread Peter Jakobsson
On 29 Oct 2016, at 19:41, Peter Bozek wrote: > Now $object1 and $object2 create a circular reference (and debugger will > show it cannot display such object), they may not be cleared from memory > when method ends (will not be cleared ever.) Hi Peter Thats an interesting one. Will need to expl

Re: Progressive slow

2016-10-29 Thread stardata.info
I not have done any changes.. I compile the my application only. Please you can explain better the several steps? Thanks /Ferdinando/ Il 29/10/2016 17:50, 4d_tech-requ...@lists.4d.com ha scritto: Message: 8 Date: Fri, 28 Oct 2016 22:52:25 -0400 From: Randy Jaynes To: 4D iNug Technical<4d_t

Re: Object Arrays - Very Interesting "Watchas"

2016-10-29 Thread Peter Bozek
On Sat, Oct 29, 2016 at 1:28 PM, Peter Jakobsson wrote: > > The question is, what does 4D do to object spaces that are only referenced by locals ? I imagine that to avoid memory leaks, it must keep track of all references and delete the object space when all references have dropped out of scope. C

Re: Object Arrays - Very Interesting "Watchas"

2016-10-29 Thread Peter Jakobsson
Hi Jeremy Thats a nice way of doing it. I’ll use that in future in this scenario I think. Thanks ! Peter On 29 Oct 2016, at 16:45, Jeremy French wrote: > Have you tried using OB Copy? > > That is, you would do: > > APPEND TO ARRAY($arrOBJECTS;OB Copy($myObject)) **

Re: Object Arrays - Very Interesting "Watchas"

2016-10-29 Thread Jeremy French
HI Peter, Have you tried using OB Copy? That is, you would do: APPEND TO ARRAY($arrOBJECTS;OB Copy($myObject)) Using OB Copy will retain the object value at time of assignment to the array element. More details at: http://doc.4d.com/4Dv15R5/4D/15-R5/OB-Copy.301-2936604.en.html - Jeremy Fren

Object Arrays - Very Interesting "Watchas"

2016-10-29 Thread Peter Jakobsson
Hi Apologies if this has been discussed before - I haven’t kept up with all threads on the topic but noticed this interesting behaviour just now. I thought it was a bug at first but now I see it’s a feature, albeit a slightly un-intuitive one based on what we’re used to. If I do this……..