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
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
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
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
//---
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
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
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
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))
**
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
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……..
10 matches
Mail list logo