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($arrOBJECTS;$myObject)
CLEAR VARIABLE($myObject)  // <— New

OB SET($myObject;"myName";"George")
APPEND TO ARRAY($arrOBJECTS;$myObject)
CLEAR VARIABLE($myObject)  // <— New



> On Oct 29, 2016, at 4:28 AM, Peter Jakobsson <[email protected]> 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 ARRAY($arrOBJECTS;$myObject)
> 
> OB SET($myObject ;"myName”;”Sandra”)
> APPEND TO ARRAY($arrOBJECTS;$myObject)
> 
> OB SET($myObject ;"myName”;”George”)
> APPEND TO ARRAY($arrOBJECTS;$myObject)
> ====================================================

**********************************************************************
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:[email protected]
**********************************************************************

Reply via email to