Re: How to clear an object?
Jorg, If you are using $MyGreatObj in a loop or some situation where you are reusing it you can also do: For each ($MyGreatObj; $someDataStructure) $MyGreatObj:=New Object $myGreatObj:= $someOtherObj.greatProp:=$MyGreatObj End for each Remember that unlike other reference items from the past (menus and lists) when you create an object using $anything:=New Object its scope is a local variable. So when the method that created it ends the variable is cleared too UNLESS you assigned it to a non-local variable. This made me curious so I just checked out how this works in the debugger: C_OBJECT($myGreatObj) // $myGreatObj = null $myGreatObj:=New object // $myGreatObj = {} CLEAR VARAIBLE($myGreatObj) // $myGreatObj = null So we can say New object initializes the object as empty and CLEAR VARIABLE sets it to null, which is equivalent to $myGreatObj:=null. On Sun, Aug 11, 2019 at 1:03 AM Jörg Knebel via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Happy Sunday to all, > > Just wondering how would one clear/delete/vaporise a 4D object (Language): > > C_Object($MyGreatObject) > > $MyGreatObject:= New Object > $MyGreatObject:=Get system info > > // playing around with the object > > Now I want to clear/vaporise the object before I go on, but not set all > the properties to NULL > > > > Would the object have been created by ObjectTools I’d simply use > > OT Clear ($MyGreatObject). > > > Any pointers anyone? > > Thanks > > Cheers > Jörg > ** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** -- Kirk Brooks San Francisco, CA === What can be said, can be said clearly, and what you can’t say, you should shut up about *Wittgenstein and the Computer * ** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: How to clear an object?
> OT Clear ($MyGreatObject). CLEAR VARIABLE -- Grüße/Regards, [heubach-media] | Christian Sakowski christian.sakow...@heubach-media.de Tel: +49/(0)40/41 455 455 > Am 11.08.2019 um 10:03 schrieb Jörg Knebel via 4D_Tech <4d_tech@lists.4d.com>: > > Happy Sunday to all, > > Just wondering how would one clear/delete/vaporise a 4D object (Language): > > C_Object($MyGreatObject) > > $MyGreatObject:= New Object > $MyGreatObject:=Get system info > > // playing around with the object > > Now I want to clear/vaporise the object before I go on, but not set all the > properties to NULL > > > > Would the object have been created by ObjectTools I’d simply use > > OT Clear ($MyGreatObject). > > > Any pointers anyone? > > Thanks > > Cheers > Jörg > ** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** -- heubach media Osterfeldstr. 12-14 | Haus 1 | Eingang Nord 22529 Hamburg tel: 040 / 52 10 59 - 10 | fax: -99 mail: i...@heubach-media.de home: www.heubach-media.de Geschäftsführer|CEO: Matthias Heubach Mieten Sie Ihre Computer, iPads & Drucker für Ihre Events bei: http://www.milo-rental.com ** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
How to clear an object?
Happy Sunday to all, Just wondering how would one clear/delete/vaporise a 4D object (Language): C_Object($MyGreatObject) $MyGreatObject:= New Object $MyGreatObject:=Get system info // playing around with the object Now I want to clear/vaporise the object before I go on, but not set all the properties to NULL Would the object have been created by ObjectTools I’d simply use OT Clear ($MyGreatObject). Any pointers anyone? Thanks Cheers Jörg ** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **