Re: Convert Object to shared object.

2020-03-06 Thread Eric Naujock via 4D_Tech
Thanks, That helped a lot.

> On Mar 5, 2020, at 3:49 PM, John DeSoi via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> https://kb.4d.com/assetid=78197 
**
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: Convert Object to shared object.

2020-03-05 Thread John DeSoi via 4D_Tech
https://kb.4d.com/assetid=78197

John DeSoi, Ph.D.


> On Mar 5, 2020, at 1:40 PM, Eric Naujock via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Does anyone know of a way to simply convert an object to a shred object. I 
> have tried numerous methods to get this done but I have found that nothing 
> seems to want to allow an easy conversion from a c_object type to a shared 
> object. Though in reality what I really want to do is convert a collection of 
> objects to a shared collection of objects to place in the Storage object. 

**
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
**

Convert Object to shared object.

2020-03-05 Thread Eric Naujock via 4D_Tech
Does anyone know of a way to simply convert an object to a shred object. I have 
tried numerous methods to get this done but I have found that nothing seems to 
want to allow an easy conversion from a c_object type to a shared object. 
Though in reality what I really want to do is convert a collection of objects 
to a shared collection of objects to place in the Storage object. 
**
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: Stuffing a shared object

2019-07-16 Thread Jeremy Roussak via 4D_Tech
Thanks, Keith. I had wondered about writing a method to copy each element of 
the non-shared object into the shared object, but couldn’t believe that there 
wasn’t a simpler way of doing it - hence my question. Clearly, I was wrong.

Jeremy

> On 16 Jul 2019, at 09:14, Keith White via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi
> 
> I know you've sorted out an elegant solution using CALL WORKER, but just in 
> case you do need to copy to a shared object or collection in the future, 
> please see https://kb.4d.com/assetid=78197
> 
> Best regards
> 
> Keith White
**
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: Stuffing a shared object

2019-07-16 Thread Keith White via 4D_Tech
Hi

I know you've sorted out an elegant solution using CALL WORKER, but just in 
case you do need to copy to a shared object or collection in the future, please 
see https://kb.4d.com/assetid=78197

Best regards

Keith White
Synergist Express Ltd, UK.
4697775
**
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: Stuffing a shared object

2019-07-15 Thread Jeremy Roussak via 4D_Tech
Kirk, you are so right. Thank you: after ten minutes’ work I have a solution 
which both works and is enormously more elegant.

Jeremy

> On 15 Jul 2019, at 17:05, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Jeremy,
> It's easy to keep trying to do everything the same way we have for years.
> That's why a list like this is so useful.
> 
> On Mon, Jul 15, 2019 at 9:01 AM Jeremy Roussak via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Kirk,
>> 
>> Now why didn’t I think of that? It’s exactly what CALL WORKER is for,
>> isn’t it?
>> 
>> Jeremy
>> 
>>> On 15 Jul 2019, at 16:44, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com>
>> wrote:
>>> 
>>> Jeremy,
>>> I don't think this would be a good situation for using Shared objects.
>>> Every object in a shared object must itself be shared. There's a lot of
>>> overhead involved in maintaining the various lockers and such.
>>> 
>>> I would look at using CALL WORKER. Bundle up everything into an object
>> and
>>> pack it off to a worker. When the worker is done the results come back
>> via
>>> CALL FORM. This will be faster and easier.
>>> 
>>> 
>>> On Mon, Jul 15, 2019 at 8:27 AM Jeremy Roussak via 4D_Tech <
>>> 4d_tech@lists.4d.com> wrote:
>>> 
>>>> I have a form which accepts some information and, when a button is
>>>> clicked, does some fairly time-consuming calculations which return a
>> set of
>>>> figures. At present, it uses objects with the Form object for input and
>>>> output data.
>>>> 
>>>> I’d like to hand off the calculations to a separate process. As I
>>>> understand it, I can’t pass the Form object to the new process but have
>> to
>>>> create a shared object.
>>>> 
>>>> How do I get the information from the Form object into the new shared
>>>> object? I’ve tried
>>>> 
>>>>   $shared.formObj := OB Copy(Form)
>>>> 
>>>> but it gives a error: “Not supported value in a shared object”.
>>>> 
>>>> Am I, as so often, missing something obvious?
>>>> 
>>>> Jeremy
>>>> **
>>>> 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
>>> **
>> 
>> **
>> 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
> **

**
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: Stuffing a shared object

2019-07-15 Thread Kirk Brooks via 4D_Tech
Jeremy,
It's easy to keep trying to do everything the same way we have for years.
That's why a list like this is so useful.

On Mon, Jul 15, 2019 at 9:01 AM Jeremy Roussak via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Kirk,
>
> Now why didn’t I think of that? It’s exactly what CALL WORKER is for,
> isn’t it?
>
> Jeremy
>
> > On 15 Jul 2019, at 16:44, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> >
> > Jeremy,
> > I don't think this would be a good situation for using Shared objects.
> > Every object in a shared object must itself be shared. There's a lot of
> > overhead involved in maintaining the various lockers and such.
> >
> > I would look at using CALL WORKER. Bundle up everything into an object
> and
> > pack it off to a worker. When the worker is done the results come back
> via
> > CALL FORM. This will be faster and easier.
> >
> >
> > On Mon, Jul 15, 2019 at 8:27 AM Jeremy Roussak via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >
> >> I have a form which accepts some information and, when a button is
> >> clicked, does some fairly time-consuming calculations which return a
> set of
> >> figures. At present, it uses objects with the Form object for input and
> >> output data.
> >>
> >> I’d like to hand off the calculations to a separate process. As I
> >> understand it, I can’t pass the Form object to the new process but have
> to
> >> create a shared object.
> >>
> >> How do I get the information from the Form object into the new shared
> >> object? I’ve tried
> >>
> >>$shared.formObj := OB Copy(Form)
> >>
> >> but it gives a error: “Not supported value in a shared object”.
> >>
> >> Am I, as so often, missing something obvious?
> >>
> >> Jeremy
> >> **
> >> 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
> > **
>
> **
> 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: Stuffing a shared object

2019-07-15 Thread Jeremy Roussak via 4D_Tech
Kirk,

Now why didn’t I think of that? It’s exactly what CALL WORKER is for, isn’t it? 

Jeremy

> On 15 Jul 2019, at 16:44, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Jeremy,
> I don't think this would be a good situation for using Shared objects.
> Every object in a shared object must itself be shared. There's a lot of
> overhead involved in maintaining the various lockers and such.
> 
> I would look at using CALL WORKER. Bundle up everything into an object and
> pack it off to a worker. When the worker is done the results come back via
> CALL FORM. This will be faster and easier.
> 
> 
> On Mon, Jul 15, 2019 at 8:27 AM Jeremy Roussak via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> I have a form which accepts some information and, when a button is
>> clicked, does some fairly time-consuming calculations which return a set of
>> figures. At present, it uses objects with the Form object for input and
>> output data.
>> 
>> I’d like to hand off the calculations to a separate process. As I
>> understand it, I can’t pass the Form object to the new process but have to
>> create a shared object.
>> 
>> How do I get the information from the Form object into the new shared
>> object? I’ve tried
>> 
>>$shared.formObj := OB Copy(Form)
>> 
>> but it gives a error: “Not supported value in a shared object”.
>> 
>> Am I, as so often, missing something obvious?
>> 
>> Jeremy
>> **
>> 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
> **

**
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: Stuffing a shared object

2019-07-15 Thread Kirk Brooks via 4D_Tech
Jeremy,
I don't think this would be a good situation for using Shared objects.
Every object in a shared object must itself be shared. There's a lot of
overhead involved in maintaining the various lockers and such.

I would look at using CALL WORKER. Bundle up everything into an object and
pack it off to a worker. When the worker is done the results come back via
CALL FORM. This will be faster and easier.


On Mon, Jul 15, 2019 at 8:27 AM Jeremy Roussak via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I have a form which accepts some information and, when a button is
> clicked, does some fairly time-consuming calculations which return a set of
> figures. At present, it uses objects with the Form object for input and
> output data.
>
> I’d like to hand off the calculations to a separate process. As I
> understand it, I can’t pass the Form object to the new process but have to
> create a shared object.
>
> How do I get the information from the Form object into the new shared
> object? I’ve tried
>
> $shared.formObj := OB Copy(Form)
>
> but it gives a error: “Not supported value in a shared object”.
>
> Am I, as so often, missing something obvious?
>
> Jeremy
> **
> 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
**

Stuffing a shared object

2019-07-15 Thread Jeremy Roussak via 4D_Tech
I have a form which accepts some information and, when a button is clicked, 
does some fairly time-consuming calculations which return a set of figures. At 
present, it uses objects with the Form object for input and output data.

I’d like to hand off the calculations to a separate process. As I understand 
it, I can’t pass the Form object to the new process but have to create a shared 
object.

How do I get the information from the Form object into the new shared object? 
I’ve tried

$shared.formObj := OB Copy(Form)
 
but it gives a error: “Not supported value in a shared object”.

Am I, as so often, missing something obvious?

Jeremy
**
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: Shared Object - NOT!

2018-10-22 Thread Peter Bozek via 4D_Tech
On Mon, Oct 22, 2018 at 5:10 PM Keith Culotta via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> If a method creates an object ($no:=new object), the object is destroyed
> when the method ends?
> and
> if a method creates a new shared object ($nso:=new shared object), the
> object continues to exist after the method ends, but the reference to it is
> lost?  Does 4D know to clear the object in this case?
>
>
Keith,

AFAIK, object - standard or shared -  is destroyed when it refcount is
zero, what means when there is nothing that references it anymore.

This means that when a method creates new object
$no:=New object
fact that $no is local variable matters to the extend that, when methods
ends, $no gets out of scope and the refcount of the object is decreased by
1. If no other variable refers to the object, it is destroyed. However,
there may be other variables that refer to that object, if you do something
like
procesVar:=$no
or
SomeMethod($no)

In this case, object exist till last variable stopp to reference it.

--

Peter Bozek
**
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: Shared Object - NOT!

2018-10-22 Thread Keith Culotta via 4D_Tech
If a method creates an object ($no:=new object), the object is destroyed when 
the method ends?
and
if a method creates a new shared object ($nso:=new shared object), the object 
continues to exist after the method ends, but the reference to it is lost?  
Does 4D know to clear the object in this case?

Keith - CDI

> On Oct 20, 2018, at 11:28 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> I prefer to explain it this way:
> 
> when you pass a New object or New collection  to a method (subroutine),
> that object or collection is shared between the 2 methods, caller and callee,
> because they are running in the same process.
> 
> if you execute $1.foo:="bar" in the callee,
> the object from the caller is also updated,
> because they are in fact referenced to the same object.
> 
> if you do the same across processes,
> i.e. pass a New object or New collection to New process, CALL WORKER or CALL 
> FORM,
> the object or collection is not shared between the 2 methods, caller and 
> callee,
> because they are not running in the same process.
> 
> the best way to share an object or collection between processes is to pass a 
> shared object or shared collection as a parameter.
> there is no need to use Storage, there is no need to use interprocess 
> variables.
> you just create a shared object or shared collection, and pass it as an 
> argument to another process or worker.
> the received object is not a copy, it is a shared reference to the same 
> shared object.
> 
> Storage is not mandatory, if you always pass shared objects using parameters,
> which is good practice, according the law of Demeter.
> 
> https://en.wikipedia.org/wiki/Law_of_Demeter
> 
> the reason why Storage often pops up in the context of interprocess variables,
> is because we recognise that in many applications, interprocess variables are 
> casually references all over the place.
> it is provided as a last resort, a global shared object to which you can 
> attach all your shared objects
> so that you can access them from anywhere in your code, without using 
> parameters.
> 
>> 2018/10/21 13:11、lists via 4D_Tech <4d_tech@lists.4d.com>のメール:
>> 
>> In order to share an object between processes without using an interprocess 
>> variable, you must use the "Storage" container/catalog.
> 
> 
> 
> 
> **
> 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: Shared Object - NOT!

2018-10-21 Thread Peter Bozek via 4D_Tech
On Sun, Oct 21, 2018 at 7:36 PM Kirk Brooks via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
>
> Personally I have a lot of concepts about how to do code operation in 4D
> that are strongly rooted in what it was possible to do in 4D. ORDA
> frequently goes in a different direction and the optimal ORDA solutions
> look much different than I'm accustomed to. Usually cleaner, tighter and
> less code. Not always, but usually.
>
>
Kirk,

I think you misunderstood what is in my opinion very good discussion. The
question was not how to refactor some 4D code to ORDA, rather how to solve
some problems (that can be solved with interprocess named selection and
sets) in ORDA. The discussion split to several venues - would it be wise to
implement, can it be circumvented by redesigning the problem and if not,
how to implement it?

While discussion si (I hope) not finished, it seems to me that currently
ORDA does not offer efficient solution - although the situation can change
in the future - and it is wise to try to avoid sharing selections by using
another new feature, support for several active windows within one process.
Such solution may have its own problems, though.

--

Peter Bozek
**
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: Shared Object - NOT!

2018-10-21 Thread Keisuke Miyako via 4D_Tech
it's a silly example anyway,
but to be clear,

cat:=New collecrtion(cat;cat;cat)

cat[0].food:="prawn"


should read

cats:=New collection(cat;cat;cat)

and

cats[0].food:="prawn"


**
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: Shared Object - NOT!

2018-10-21 Thread Keisuke Miyako via 4D_Tech
the sharing of process sets and named selections between a client process and 
its server twin process seems to me like a very deliberate feature.

http://doc.4d.com/4Dv15/4D/15.6/4D-Server-Sets-and-Named-Selections.300-3838966.en.html

for those who are not familiar with this feature,
a process set created on the client side is visible and available in its server 
twin process, and vice versa.

the reason I say it must be deliberate is because the request log clearly shows 
that a copy is performed to make this implicit feature work.

objects are references, so there is no "sharing" across machines.
someone needs to marshal and copy it over the network.

when you pass an object or collection to a method executed on the server, (or 
the other way round, execute on client)
an implicit VARIABLE TO BLOB is performed.

what is different in v17 to is that references "internal" to that object is 
replicated.
that was not the case in v16; it was more like strigification.

one example of an internal reference is a recursive object.

cat:=New object
kitten:=New object("mother":cat)
cat.kitten:=kitten

in this example we have 2 objects, one inside the other.
but the inner object has a recursive reference to the outer,
so a stringified version would go on forever,

cat.kitten.mother.kitten.mother.kitten.

v17 can BLOB-ify this kind of object and pass it to a method executed on the 
server.
it can also save it to a field, or a file, and restore it as a recursive object.

another example is multiple referencing of the same internal object.

cat:=New object("food":"tuna")
cat:=New collecrtion(cat;cat;cat)

in this example we have 2 objects, one inside the other.
but the inner object is referenced multiple times.
if the object is stringified, it would look like there are 4 objects. (3 + 1 
collection)

[{"food":"tuna"},{"food":"tuna"},{"food":"tuna"}]

and parsing it would indeed create 4 objects.

v17 can BLOB-ify and restore these kinds of objects, keeping its internal 
references.

so if the recipient method executed on server does

cat[0].food:="prawn"

all 3 instances of cat.food would be updated, because they all reference the 
same object.



**
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: Shared Object - NOT!

2018-10-21 Thread Kirk Brooks via 4D_Tech
Peter,

On Sun, Oct 21, 2018 at 5:04 AM Peter Bozek via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> On Sun, Oct 21, 2018 at 12:41 PM Keisuke Miyako via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> > the request is more like,
> > "I want to make a query in process B change the current selection of
> > process A, and vice versa".
> > why would you want that?
>
> I am using interprocess sets and named selections - not very often, but I
> still do in all at least a bit more complex projects.
>

I think there are a number of cases where solutions for tricky issues that
work, and work well, in prior versions of 4D do not work well using ORDA.
And frankly attempting to hammer those solutions into the ORDA language
doesn't do any good.

I strongly suspect there is another way to accomplish the end result you
need using tools available in ORDA but it's going to require re-thinking
the problem from the beginning. What is the task or operation you want to
accomplish? What's that result look like as an entity selection, collection
or whatever? Then it becomes 'how do I get that result using the tools
available?' That's where I find ORDA is most powerful - using it for what
it's designed to do. I am not finding it particularly beneficial as a
replacement for perfectly good, old 4D code. The fact it's a shiny new
widget doesn't make it useful for everything.

In this case your previous work may be perfectly fine and not worth the
effort to retro fit.

Personally I have a lot of concepts about how to do code operation in 4D
that are strongly rooted in what it was possible to do in 4D. ORDA
frequently goes in a different direction and the optimal ORDA solutions
look much different than I'm accustomed to. Usually cleaner, tighter and
less code. Not always, but usually.

-- 
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: Shared Object - NOT!

2018-10-21 Thread Kirk Brooks via 4D_Tech
Miyako,


On Sat, Oct 20, 2018 at 9:29 PM Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> if you do the same across processes,
> i.e. pass a New object or New collection to New process, CALL WORKER or
> CALL FORM,
> the object or collection is not shared between the 2 methods, caller and
> callee,
> because they are not running in the same process.
>
I know this has also been true when passing an object to a method which
execute on server. Is it something that may change in the future? I'm
thinking about the characteristic os sets to be shared between the twin
server process and the client within a process and wondering if it may
extend to objects?

-- 
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: Shared Object - NOT!

2018-10-21 Thread Chip Scheide via 4D_Tech
Not to mention how much old/legacy code would likely break

> 
> the language might be more consistent if 4D got rid of all native 
> scalar types and treating everything as an object,
> but there is a performance advantage (memory footprint and speed) in 
> having scalar native types.

Hell is other people 
 Jean-Paul Sartre
**
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: Shared Object - NOT!

2018-10-21 Thread Keisuke Miyako via 4D_Tech
in addition to the distinction between shared and non-shared objects,
we need to be aware of the distinction between objects and non-objects.

the 4D language is different from script coding languages such as JS or PHP,
in that scalar types such as boolean, long, date, time are not objects.
they are native data types.

for instance, we know that

collection1:=collection2

is just a duplication of the object reference, not the object itself.

but long:=collection.longProperty

is a duplication of a native scalar value itself,
because numbers in 4D are not objects.

you can see the distinction in the documentation of "For each".

http://doc.4d.com/4Dv17/4D/17/For-eachEnd-for-each.300-3754311.en.html

(jump to keyword "scalar")

if you run a "For each" on a collection of objects,
the item you get in $1 is an object in the collection, which is a reference.
so updating it will directly update the object inside the collection.

but if you run a "For each" on a collection of scalar values,
the item you get in $1 is a copy of the value in the collection,
so updating it will not change the value inside the collection.

the ":=" operator is not inconstant.
what is really "inconsistent", is the nature of value types.

assigning an object or collection to another
is like assigning a DocRef (time), MenuRef (string), XMLRef (string), List 
(number) to another.
the operator never created a new file pointer, menu, XML node or list.

an object or collection property of a shared object is shared,
but a scalar property of a shared object is not,
because a scalar property is not an object,
which means it is not a reference,
which means there is no concept of sharing.

the language might be more consistent if 4D got rid of all native scalar types 
and treating everything as an object,
but there is a performance advantage (memory footprint and speed) in having 
scalar native types.

2018/10/21 21:04、Peter Bozek 
mailto:peter.bo...@gmail.com>>のメール:

it would be nice if assignment operator honored shared property as well and 
constructs like
collection:=selection.ID
would keep collection a shared one if it was before (and similar to assignment 
of collection created with .copy() .)




**
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: Shared Object - NOT!

2018-10-21 Thread Peter Bozek via 4D_Tech
On Sun, Oct 21, 2018 at 12:41 PM Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> you will probably not like my answer, but here goes.
>
> for creating a shared collection from a 4D array,
> ARRAY TO COLLECTION has a special syntax that does just that.
> the trick is to pass a New shared collection to the command.
>
> http://doc.4d.com/4Dv17/4D/17/ARRAY-TO-COLLECTION.301-3730916.en.html
>
>
it would be nice if assignment operator honored shared property as well and
constructs like
collection:=selection.ID
would keep collection a shared one if it was before (and similar to
assignment of collection created with .copy() .)


>
> I believe that such feature is in development and will be available pretty
> soon.
>




> but on entity collections, I don't understand why that would be necessary.
>
> first, I disagree with the interprocess named selection analogy.
>
> the request is more like,
> "I want to make a query in process B change the current selection of
> process A, and vice versa".
> why would you want that?
>

I am using interprocess sets and named selections - not very often, but I
still do in all at least a bit more complex projects.


>
> yet,  the "Use" and "End use" locking system would do nothing to protect
> data integrity,
> because any other process can update or delete an entity outside of the
> entity selection.
> I don't see any value in such a tortured system.
>

The same can be said about interprocess named selections and sets.   While
yes, there is a question of consistency, people understand that well and I
do not remember any complains regarding this. Note that you do not have to
have different processes - you can delete entity belonging to selection
within the same process and run into the same situation.

>
> if the goal is to share entity selections between windows,
> then it would make more sense to run those windows in the same process.
>

Yes, this is true and I was thinking about it. However, I feel that this is
currently not very well documented and there are not many example databases
that would  help me understand how to properly implement multiple active
windows in the same process. Do you have some suggestions what to look at?
(Yes, I know about DIALOG (... ;*) syntax.)


> the scope of an entity selection is the process which has practical
> benefits.
> there must be a really strong argument to justify breaking that rule.
>


I do not fully understand what is the benefit 9or difference) of having, in
one process, two windows showing and manipulating the same entity
selection, or two selections cloned with .copy() command, and having two
windows in two processes displaying two synchronized selections.

--

Peter Bozek
**
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: Shared Object - NOT!

2018-10-21 Thread Keisuke Miyako via 4D_Tech
you will probably not like my answer, but here goes.

for creating a shared collection from a 4D array,
ARRAY TO COLLECTION has a special syntax that does just that.
the trick is to pass a New shared collection to the command.

http://doc.4d.com/4Dv17/4D/17/ARRAY-TO-COLLECTION.301-3730916.en.html

for objects and collections in general,
there is obviously a need to create a shared copy in one shot,
especially in the context of JSON Parse.

I believe that such feature is in development and will be available pretty soon.

-

but on entity collections, I don't understand why that would be necessary.

first, I disagree with the interprocess named selection analogy.

the request is more like,
"I want to make a query in process B change the current selection of process A, 
and vice versa".
why would you want that?

if an entity selection was shared between processes,
you would have to active its locker mutex,
every time you access it,
 on both sides.

yet,  the "Use" and "End use" locking system would do nothing to protect data 
integrity,
because any other process can update or delete an entity outside of the entity 
selection.
I don't see any value in such a tortured system.

if the goal is to share entity selections between windows,
then it would make more sense to run those windows in the same process.

the scope of an entity selection is the process which has practical benefits.
there must be a really strong argument to justify breaking that rule.

> 2018/10/21 17:17、Peter Bozek のメール:
> is there a way how to convert non-shared collection to shared? Some commands 
> return normal collection, like
> selection.toCollection("ID") or collection:=selection.ID
> and I want to pass the collection to other process without duplication, but 
> have not found a way how to convert normal selection to shared one.




**
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: Shared Object - NOT!

2018-10-21 Thread Peter Bozek via 4D_Tech
On Sun, Oct 21, 2018 at 6:29 AM Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:
>
> the best way to share an object or collection between processes is to
pass a shared object or shared collection as a parameter.
> there is no need to use Storage, there is no need to use interprocess
variables.
> you just create a shared object or shared collection, and pass it as an
argument to another process or worker.
> the received object is not a copy, it is a shared reference to the same
shared object.
>

Keisuke,

is there a way how to convert non-shared collection to shared? Some
commands return normal collection, like
selection.toCollection("ID") or collection:=selection.ID
and I want to pass the collection to other process without duplication, but
have not found a way how to convert normal selection to shared one.

Tried
collection:=New shared collection
collection:=selection.ID
but it seems collection was reverted to normal one. When I tried

Use (Storage)
  Storage.collection:=New shared collection
  Storage.collection:=$settings.ID
End use

I got a runtime error. Even

Use (Storage)
  Storage.collection:=New shared collection
  Storage.collection:=$collection.copy()
End use

is not possible, although this is what I want to avoid.

Best would be to have shared entity selection - like interprocess named
selections - which would then generate shared collections.

--

Peter Bozek
**
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: Shared Object - NOT!

2018-10-20 Thread Keisuke Miyako via 4D_Tech
I prefer to explain it this way:

when you pass a New object or New collection  to a method (subroutine),
that object or collection is shared between the 2 methods, caller and callee,
because they are running in the same process.

if you execute $1.foo:="bar" in the callee,
the object from the caller is also updated,
because they are in fact referenced to the same object.

if you do the same across processes,
i.e. pass a New object or New collection to New process, CALL WORKER or CALL 
FORM,
the object or collection is not shared between the 2 methods, caller and callee,
because they are not running in the same process.

the best way to share an object or collection between processes is to pass a 
shared object or shared collection as a parameter.
there is no need to use Storage, there is no need to use interprocess variables.
you just create a shared object or shared collection, and pass it as an 
argument to another process or worker.
the received object is not a copy, it is a shared reference to the same shared 
object.

Storage is not mandatory, if you always pass shared objects using parameters,
which is good practice, according the law of Demeter.

https://en.wikipedia.org/wiki/Law_of_Demeter

the reason why Storage often pops up in the context of interprocess variables,
is because we recognise that in many applications, interprocess variables are 
casually references all over the place.
it is provided as a last resort, a global shared object to which you can attach 
all your shared objects
so that you can access them from anywhere in your code, without using 
parameters.

> 2018/10/21 13:11、lists via 4D_Tech <4d_tech@lists.4d.com>のメール:
>
> In order to share an object between processes without using an interprocess 
> variable, you must use the "Storage" container/catalog.




**
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: Shared Object - NOT!

2018-10-20 Thread lists via 4D_Tech
Hi Pat,

In order to share an object between processes without using an interprocess 
variable, you must use the "Storage" container/catalog. 
In your startup:

Use(Storage)
Storage.TriggerState:= New shared object
End use


Later in your subsequent code, you assign the contents:

$MyTrigger:= Storage.TriggerState

Use($MyTrigger) 
$ MyTrigger.processnumber:=$state
End use

Lahav


-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Pat Bensky via 4D_Tech
Sent: Saturday, October 20, 2018 9:51 AM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Cc: Pat Bensky 
Subject: Re: Shared Object - NOT!

That's how the example in the docs is.
I've tried it with a process variable - same problem.

Pat

On Sat, 20 Oct 2018 at 15:52, Paul Lovejoy via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> How could it be shared between processes with a name starting with $?
>
>
>
> Paul
>
> > On 20 Oct 2018, at 15:50, Pat Bensky via 4D_Tech 
> > <4d_tech@lists.4d.com>
> wrote:
> >
> > Well I guess I must be doing something wrong :) Using v17r3:
> >
> > In the Startup method I create a new Shared Object:
> >
> > *C_OBJECT*($objTriggerState)  // 20/10/18
> >
> > $objTriggerState:=*New shared object*()
> >
> >
> > Subsequently I want to add something to that object.
> >
> >
> > $State:="on"
> >
> > *Use* ($objTriggerState)
> >
> > processnumber:=*String*(*Current process*)
> >
> > $objTriggerState.processnumber:=$State
> >
> > *End use*
> >
> > But I get an error because $objTriggerState is undefined.
> >
> > According to the docs:
> >
> > "*Shared objects* and *shared collections* are specific objects and 
> > collections *whose contents are shared between processes*."
> >
> > So why is the object undefined?
> >
> > It works OK if the object is an interprocess variable, but that's a 
> > bit pointless isn't it?
> >
> > Pat
> >
> > --
> > *
> > CatBase - Top Dog in Data Publishing
> > tel: +44 (0) 207 118 7889
> > w: http://www.catbase.com
> > skype: pat.bensky
> > *
> > 
> > **
> > 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
> **



--
*
CatBase - Top Dog in Data Publishing
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*
**
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: Shared Object - NOT!

2018-10-20 Thread Christian Sakowski via 4D_Tech
Hi Pat,

> But I get an error because $objTriggerState is undefined.

This cannot be true, because you used New shared object.
Please use the debugger and check your code.
I suppose you are using the latest v17 build and you have dot-notation turned 
on.
--

Grüße/Regards,
[heubach-media] | Christian Sakowski
christian.sakow...@heubach-media.de
Tel: +49/(0)40/52 10 59-23




> Am 20.10.2018 um 15:50 schrieb Pat Bensky via 4D_Tech <4d_tech@lists.4d.com>:
> 
> Well I guess I must be doing something wrong :)
> Using v17r3:
> 
> In the Startup method I create a new Shared Object:
> 
> *C_OBJECT*($objTriggerState)  // 20/10/18
> 
> $objTriggerState:=*New shared object*()
> 
> 
> Subsequently I want to add something to that object.
> 
> 
> $State:="on"
> 
> *Use* ($objTriggerState)
> 
> processnumber:=*String*(*Current process*)
> 
> $objTriggerState.processnumber:=$State
> 
> *End use*
> 
> But I get an error because $objTriggerState is undefined.
> 
> According to the docs:
> 
> "*Shared objects* and *shared collections* are specific objects and
> collections *whose contents are shared between processes*."
> 
> So why is the object undefined?
> 
> It works OK if the object is an interprocess variable, but that's a bit
> pointless isn't it?
> 
> Pat
> 
> -- 
> *
> CatBase - Top Dog in Data Publishing
> tel: +44 (0) 207 118 7889
> w: http://www.catbase.com
> skype: pat.bensky
> *
> **
> 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: Shared Object - NOT!

2018-10-20 Thread Pat Bensky via 4D_Tech
That's how the example in the docs is.
I've tried it with a process variable - same problem.

Pat

On Sat, 20 Oct 2018 at 15:52, Paul Lovejoy via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> How could it be shared between processes with a name starting with $?
>
>
>
> Paul
>
> > On 20 Oct 2018, at 15:50, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> >
> > Well I guess I must be doing something wrong :)
> > Using v17r3:
> >
> > In the Startup method I create a new Shared Object:
> >
> > *C_OBJECT*($objTriggerState)  // 20/10/18
> >
> > $objTriggerState:=*New shared object*()
> >
> >
> > Subsequently I want to add something to that object.
> >
> >
> > $State:="on"
> >
> > *Use* ($objTriggerState)
> >
> > processnumber:=*String*(*Current process*)
> >
> > $objTriggerState.processnumber:=$State
> >
> > *End use*
> >
> > But I get an error because $objTriggerState is undefined.
> >
> > According to the docs:
> >
> > "*Shared objects* and *shared collections* are specific objects and
> > collections *whose contents are shared between processes*."
> >
> > So why is the object undefined?
> >
> > It works OK if the object is an interprocess variable, but that's a bit
> > pointless isn't it?
> >
> > Pat
> >
> > --
> > *
> > CatBase - Top Dog in Data Publishing
> > tel: +44 (0) 207 118 7889
> > w: http://www.catbase.com
> > skype: pat.bensky
> > *
> > **
> > 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
> **



-- 
*
CatBase - Top Dog in Data Publishing
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*
**
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: Shared Object - NOT!

2018-10-20 Thread Paul Lovejoy via 4D_Tech
How could it be shared between processes with a name starting with $?



Paul 

> On 20 Oct 2018, at 15:50, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Well I guess I must be doing something wrong :)
> Using v17r3:
> 
> In the Startup method I create a new Shared Object:
> 
> *C_OBJECT*($objTriggerState)  // 20/10/18
> 
> $objTriggerState:=*New shared object*()
> 
> 
> Subsequently I want to add something to that object.
> 
> 
> $State:="on"
> 
> *Use* ($objTriggerState)
> 
> processnumber:=*String*(*Current process*)
> 
> $objTriggerState.processnumber:=$State
> 
> *End use*
> 
> But I get an error because $objTriggerState is undefined.
> 
> According to the docs:
> 
> "*Shared objects* and *shared collections* are specific objects and
> collections *whose contents are shared between processes*."
> 
> So why is the object undefined?
> 
> It works OK if the object is an interprocess variable, but that's a bit
> pointless isn't it?
> 
> Pat
> 
> -- 
> *
> CatBase - Top Dog in Data Publishing
> tel: +44 (0) 207 118 7889
> w: http://www.catbase.com
> skype: pat.bensky
> *
> **
> 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
**

Shared Object - NOT!

2018-10-20 Thread Pat Bensky via 4D_Tech
Well I guess I must be doing something wrong :)
Using v17r3:

In the Startup method I create a new Shared Object:

*C_OBJECT*($objTriggerState)  // 20/10/18

$objTriggerState:=*New shared object*()


Subsequently I want to add something to that object.


$State:="on"

*Use* ($objTriggerState)

processnumber:=*String*(*Current process*)

$objTriggerState.processnumber:=$State

*End use*

But I get an error because $objTriggerState is undefined.

According to the docs:

"*Shared objects* and *shared collections* are specific objects and
collections *whose contents are shared between processes*."

So why is the object undefined?

It works OK if the object is an interprocess variable, but that's a bit
pointless isn't it?

Pat

-- 
*
CatBase - Top Dog in Data Publishing
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*
**
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

2018-09-02 Thread Keisuke Miyako via 4D_Tech
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

2018-09-02 Thread Keisuke Miyako via 4D_Tech
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

2018-09-02 Thread Kirk Brooks via 4D_Tech
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

2018-09-02 Thread Christian Sakowski via 4D_Tech
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

2018-09-01 Thread lists via 4D_Tech
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

2018-09-01 Thread David Ringsmuth via 4D_Tech
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
**