RE: Storage + New shared object
Lahav, (and Christian, and Keisuke Miyako) THANK YOU! David Ringsmuth From: lists via 4D_Tech Sent: Saturday, September 1, 2018 11:03 PM To: 4D iNug Technical Cc: lists Subject: RE: Storage + New shared object Hi David, First Both, $DeleteRecord_ob and $DeleteRecord_PN_ob must be a shared objects. Also, it seems that shared objects do not accept arrays. Convert the arrays to shared collections instead. This should work: ARRAY TEXT($DeleteRecord;Get last table number) ARRAY LONGINT($DeleteRecord_PN;Get last table number) C_COLLECTION($t) $t:=New shared collection ARRAY TO COLLECTION($t;$DeleteRecord;"DeleteRecord";$DeleteRecord_PN;"DeleteRecord_PN") Use (Storage) Storage.t:=$t End use Lahav -Original Message- From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of David Ringsmuth via 4D_Tech Sent: Saturday, September 1, 2018 9:36 PM To: 4D iNug Technical <4d_tech@lists.4d.com> Cc: David Ringsmuth Subject: Storage + New shared object I’m trying to add an object array to Storage. The documentation says that Objects can be a share storage value. I keep getting the message “Not supported value type in a shared object or shared collection.” In the below code I broke apart the assignments for easiest debugging. ARRAY TEXT($DeleteRecord;Get last table number) ARRAY LONGINT($DeleteRecord_PN;Get last table number) C_OBJECT($DeleteRecord_ob) OB SET ARRAY($DeleteRecord_ob;"DeleteRecord";$DeleteRecord) C_OBJECT($DeleteRecord_PN_ob) OB SET ARRAY($DeleteRecord_PN_ob;"DeleteRecord_PN";$DeleteRecord_PN) C_OBJECT($Delete_ob;$Delete_PN_ob) Use (Storage) Storage.t:=New shared object("DeleteRecord";$Delete_ob;"DeleteRecord_PN";$Delete_PN_ob) End use Use (Storage.t) Storage.t.DeleteRecord:=$DeleteRecord_ob // this line generated the error message Storage.t.DeleteRecord_PN:=$DeleteRecord _PN_ob// so does this line error with same message End use Please help! David Ringsmuth ** 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 ** ** 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 ** ** 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: Storage + New shared object
typo: $a.prop:="whatever" you can simply $a:="whatever" ** 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: Storage + New shared object
as others have correctly pointed out, each sub-object or sub-collection you add to a shared object must themselves be shared objects or shared collection. regarding object notation: if you do something like $a:=New shared object $b:=New shared object("a";$a) then there is no need to $b.a.prop:="whatever" you can simply $a:="whatever" and the result will be the same (you save 4D from searching the object notation path) another subtle catch is related to grouping and singleness. for example, the following would not work: Use (Storage) $a:=New shared object("a";New shared object("b";"whatever")) Storage.a:=New shared object("a";$a) End use because by creating a cascaded shared object in the first line, you create a new group, which can not transfer to a different group (Storage, in this case) you have to procedurally group objects so that they don't transfer ownership. Use (Storage) Storage.a:=New shared object("a";New shared object("b";"whatever")) $a:=Storage.a $b:=$a.a End use ** 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: Storage + New shared object
David, You need to define the objects as shared objects. You will also want to use collections instead of arrays because I don't think you can have a shared array. This works without error : *C_COLLECTION*($DeleteRecord_ob) $DeleteRecord_ob:=*New shared collection* *C_OBJECT*($DeleteRecord_PN_ob) $DeleteRecord_PN_ob:=*New shared object* *C_OBJECT*($Delete_ob;$Delete_PN_ob) $Delete_ob:=*New shared object* $Delete_PN_ob:=*New shared object* *Use* (*Storage*) *Storage*.t:=*New shared object*("DeleteRecord";$Delete_ob ;"DeleteRecord_PN";$Delete_PN_ob) *End use* *Use* (*Storage*.t) *Storage*.t.DeleteRecord:=$DeleteRecord_ob // this line generated the error message *Storage*.t.DeleteRecord_PN:=$DeleteRecord _PN_ob // so does this line error with same message *End use* On Sat, Sep 1, 2018 at 8:35 PM David Ringsmuth via 4D_Tech < 4d_tech@lists.4d.com> wrote: > I’m trying to add an object array to Storage. > > The documentation says that Objects can be a share storage value. > > I keep getting the message “Not supported value type in a shared object or > shared collection.” > > In the below code I broke apart the assignments for easiest debugging. > > ARRAY TEXT($DeleteRecord;Get last table number) > ARRAY LONGINT($DeleteRecord_PN;Get last table number) > > C_OBJECT($DeleteRecord_ob) > OB SET ARRAY($DeleteRecord_ob;"DeleteRecord";$DeleteRecord) > > C_OBJECT($DeleteRecord_PN_ob) > OB SET ARRAY($DeleteRecord_PN_ob;"DeleteRecord_PN";$DeleteRecord_PN) > > C_OBJECT($Delete_ob;$Delete_PN_ob) > > Use (Storage) > Storage.t:=New shared > object("DeleteRecord";$Delete_ob;"DeleteRecord_PN";$Delete_PN_ob) > End use > Use (Storage.t) > Storage.t.DeleteRecord:=$DeleteRecord_ob // this line generated > the error message > Storage.t.DeleteRecord_PN:=$DeleteRecord _PN_ob// so does this > line error with same message > End use > > Please help! > > David Ringsmuth > > ** > 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 === *We go vote - they go home* ** 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: Storage + New shared object
David, use the dot-Notation and use Collections as Arrays. -- Grüße/Regards, [heubach-media] | Christian Sakowski christian.sakow...@heubach-media.de iChat/AIM: SakowskiF Tel: +49/(0)40/52 10 59-23 > Am 02.09.2018 um 05:35 schrieb David Ringsmuth via 4D_Tech > <4d_tech@lists.4d.com>: > > I’m trying to add an object array to Storage. > > The documentation says that Objects can be a share storage value. > > I keep getting the message “Not supported value type in a shared object or > shared collection.” > > In the below code I broke apart the assignments for easiest debugging. > > ARRAY TEXT($DeleteRecord;Get last table number) > ARRAY LONGINT($DeleteRecord_PN;Get last table number) > > C_OBJECT($DeleteRecord_ob) > OB SET ARRAY($DeleteRecord_ob;"DeleteRecord";$DeleteRecord) > > C_OBJECT($DeleteRecord_PN_ob) > OB SET ARRAY($DeleteRecord_PN_ob;"DeleteRecord_PN";$DeleteRecord_PN) > > C_OBJECT($Delete_ob;$Delete_PN_ob) > > Use (Storage) > Storage.t:=New shared > object("DeleteRecord";$Delete_ob;"DeleteRecord_PN";$Delete_PN_ob) > End use > Use (Storage.t) > Storage.t.DeleteRecord:=$DeleteRecord_ob // this line generated the > error message > Storage.t.DeleteRecord_PN:=$DeleteRecord _PN_ob// so does this line > error with same message > End use > > Please help! > > David Ringsmuth > > ** > 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 Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. ** 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: Storage + New shared object
Hi David, First Both, $DeleteRecord_ob and $DeleteRecord_PN_ob must be a shared objects. Also, it seems that shared objects do not accept arrays. Convert the arrays to shared collections instead. This should work: ARRAY TEXT($DeleteRecord;Get last table number) ARRAY LONGINT($DeleteRecord_PN;Get last table number) C_COLLECTION($t) $t:=New shared collection ARRAY TO COLLECTION($t;$DeleteRecord;"DeleteRecord";$DeleteRecord_PN;"DeleteRecord_PN") Use (Storage) Storage.t:=$t End use Lahav -Original Message- From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of David Ringsmuth via 4D_Tech Sent: Saturday, September 1, 2018 9:36 PM To: 4D iNug Technical <4d_tech@lists.4d.com> Cc: David Ringsmuth Subject: Storage + New shared object I’m trying to add an object array to Storage. The documentation says that Objects can be a share storage value. I keep getting the message “Not supported value type in a shared object or shared collection.” In the below code I broke apart the assignments for easiest debugging. ARRAY TEXT($DeleteRecord;Get last table number) ARRAY LONGINT($DeleteRecord_PN;Get last table number) C_OBJECT($DeleteRecord_ob) OB SET ARRAY($DeleteRecord_ob;"DeleteRecord";$DeleteRecord) C_OBJECT($DeleteRecord_PN_ob) OB SET ARRAY($DeleteRecord_PN_ob;"DeleteRecord_PN";$DeleteRecord_PN) C_OBJECT($Delete_ob;$Delete_PN_ob) Use (Storage) Storage.t:=New shared object("DeleteRecord";$Delete_ob;"DeleteRecord_PN";$Delete_PN_ob) End use Use (Storage.t) Storage.t.DeleteRecord:=$DeleteRecord_ob // this line generated the error message Storage.t.DeleteRecord_PN:=$DeleteRecord _PN_ob// so does this line error with same message End use Please help! David Ringsmuth ** 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 ** ** 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 **
Storage + New shared object
I’m trying to add an object array to Storage. The documentation says that Objects can be a share storage value. I keep getting the message “Not supported value type in a shared object or shared collection.” In the below code I broke apart the assignments for easiest debugging. ARRAY TEXT($DeleteRecord;Get last table number) ARRAY LONGINT($DeleteRecord_PN;Get last table number) C_OBJECT($DeleteRecord_ob) OB SET ARRAY($DeleteRecord_ob;"DeleteRecord";$DeleteRecord) C_OBJECT($DeleteRecord_PN_ob) OB SET ARRAY($DeleteRecord_PN_ob;"DeleteRecord_PN";$DeleteRecord_PN) C_OBJECT($Delete_ob;$Delete_PN_ob) Use (Storage) Storage.t:=New shared object("DeleteRecord";$Delete_ob;"DeleteRecord_PN";$Delete_PN_ob) End use Use (Storage.t) Storage.t.DeleteRecord:=$DeleteRecord_ob // this line generated the error message Storage.t.DeleteRecord_PN:=$DeleteRecord _PN_ob// so does this line error with same message End use Please help! David Ringsmuth ** 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 **