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 <[email protected]> On Behalf Of Pat Bensky via 4D_Tech
Sent: Saturday, October 20, 2018 9:51 AM
To: 4D iNug Technical <[email protected]>
Cc: Pat Bensky <[email protected]>
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 <[email protected]>
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 
> > <[email protected]>
> 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:[email protected]
> > ********************************************************************
> > **
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************



--
*************************************************
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:[email protected]
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to