Re: Shared objects and collections

2019-09-16 Thread Keisuke Miyako via 4D_Tech
you can grow a collection implicitly using bracket notation. quote: If this element index is beyond the last existing element of the collection, the collection is automatically resized and all new intermediary elements get the null value https://doc.4d.com/4Dv17/4D/17.3/Using-object-notation.30

Re: Shared objects and collections

2019-09-14 Thread Kirk Brooks via 4D_Tech
Hi Jim, I haven't worked with Storage very much because frankly it's a pain and it's slow. I get why it's a pain and has so much overhead. Every single object has to have its own lock/unlock ('locker') mechanism and it works between preemptive processes. So cool for that - no small thing. For me it

Re: Shared objects and collections

2019-09-13 Thread Jim Crate via 4D_Tech
On Sep 9, 2019, at 9:55 PM, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> wrote: > >> So it looks like you can’t .push() a shared object onto a shared collection. > > not quite. > > a shared object is either single (solo) or multiple (once belonged to a group) > if an object joins a group,

Re: Shared objects and collections

2019-09-09 Thread Keisuke Miyako via 4D_Tech
> So it looks like you can’t .push() a shared object onto a shared collection. not quite. a shared object is either single (solo) or multiple (once belonged to a group) if an object joins a group, it is free to leave it, but it can't join another group. i.e. once you divorce your spouse, you c

Re: Shared objects and collections

2019-09-09 Thread Jim Crate via 4D_Tech
So what doesn’t work is: $sharedObj:=New Shared Collection OB_CopyToSharedObject ($catalogObj;$sharedObj) Use (Storage.MySharedCollection) Storage.MySharedCollection.push($sharedObj) End use What does work is: Storage.MySharedCollection.push(New shared object) Use (Storage.MySharedCol

Shared objects and collections

2019-09-09 Thread Jim Crate via 4D_Tech
I’m retrieving some info from an API that I’d like to cache, and I’m using v17, so I thought Storage might be a nice alternative to a process or interprocess variable. The first obstacle is that I can’t add an object from the API response to a shared collection. I found a KB article with a coupl