Getting datagrid content from other stack in Standalone

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting datagrid content from other stack in Standalone

Matthias Rebbe via use-livecode
Hi,
i am running into the following problem.
I have a datagrid on card 1 of a substack.
I can fetch this data from the mainstack w/o problems in the LC IDE and also in a standalone if the substacks are included in the executable.

But as soon as i set the  option in standalonebuilder  to "move the substacks into individual stackfiles” ii cannot fetch the data of the datagrid anymore.

What am i missing?


Regards,
Matthias

Matthias Rebbe
Tel +49 5741 310000
https://matthiasrebbe.eu <https://matthiasrebbe.eu/>‌

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Getting datagrid content from other stack in Standalone

Matthias Rebbe via use-livecode
Have you tried something like this?  It works for me.  (though I just set
the folder to the stacks location and use only the filename of the stack)
put the dgdata of grp 1 of stack "path/to/dgstack.livecode" into tDataA


On Thu, Jan 11, 2018 at 8:32 AM, Matthias Rebbe via use-livecode <
[hidden email]> wrote:

> Hi,
> i am running into the following problem.
> I have a datagrid on card 1 of a substack.
> I can fetch this data from the mainstack w/o problems in the LC IDE and
> also in a standalone if the substacks are included in the executable.
>
> But as soon as i set the  option in standalonebuilder  to "move the
> substacks into individual stackfiles” ii cannot fetch the data of the
> datagrid anymore.
>
> What am i missing?
>
>
> Regards,
> Matthias
>
> Matthias Rebbe
> Tel +49 5741 310000
> ‌https://matthiasrebbe.eu <https://matthiasrebbe.eu/>‌
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Getting datagrid content from other stack in Standalone

Matthias Rebbe via use-livecode
Don't you mean:

put the dgdata of grp 1 of CARD 1 OF stack "path/to/dgstack.livecode" into tDataA

If you are going to be using full paths for this, I recommend using my fine functions getParentCard() and getParentStack().

function getParentCard pObjectID
   put offset("card id", pObjectID) into tStartChar
   put char tStartChar to -1 of pObjectID into tCardID
   return tCardID
end getParentCard

function getParentStack pObjectID
    put offset("stack ", pObjectID) into tStartChar
    put char tStartChar to -1 of pObjectID into tParentStack
    return tParentStack
end getParentStack

As you can see they are very basic. Pass a long id of the calling object and it returns the long card ID or the long name of the parent stack. Now you can do this:

put getParentCard(the long id of me) into tThisCard
put the dgData of grp 1 of tThisCard into tDataA

Bob S


> On Jan 11, 2018, at 09:28 , Mike Bonner via use-livecode <[hidden email]> wrote:
>
> Have you tried something like this?  It works for me.  (though I just set
> the folder to the stacks location and use only the filename of the stack)
> put the dgdata of grp 1 of stack "path/to/dgstack.livecode" into tDataA


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Getting datagrid content from other stack in Standalone

Matthias Rebbe via use-livecode
Would this work with a stack on disk that hasn't been opened yet?

Definitely stealing your functions thx. :)

Oh, as to the OP, my first thought on why it wasn't working, is that the
stack wasn't open (hence the need to address it's on disk location), but
another thought occurred to me.  I'm wondering if the standalone auto
inclusions can be affected by moving substacks into separate stackfiles
 Perhaps the datagrid support libraries aren't being included?

On Fri, Jan 12, 2018 at 9:08 AM, Bob Sneidar via use-livecode <
[hidden email]> wrote:

> Don't you mean:
>
> put the dgdata of grp 1 of CARD 1 OF stack "path/to/dgstack.livecode" into
> tDataA
>
> If you are going to be using full paths for this, I recommend using my
> fine functions getParentCard() and getParentStack().
>
> function getParentCard pObjectID
>    put offset("card id", pObjectID) into tStartChar
>    put char tStartChar to -1 of pObjectID into tCardID
>    return tCardID
> end getParentCard
>
> function getParentStack pObjectID
>     put offset("stack ", pObjectID) into tStartChar
>     put char tStartChar to -1 of pObjectID into tParentStack
>     return tParentStack
> end getParentStack
>
> As you can see they are very basic. Pass a long id of the calling object
> and it returns the long card ID or the long name of the parent stack. Now
> you can do this:
>
> put getParentCard(the long id of me) into tThisCard
> put the dgData of grp 1 of tThisCard into tDataA
>
> Bob S
>
>
> > On Jan 11, 2018, at 09:28 , Mike Bonner via use-livecode <
> [hidden email]> wrote:
> >
> > Have you tried something like this?  It works for me.  (though I just set
> > the folder to the stacks location and use only the filename of the stack)
> > put the dgdata of grp 1 of stack "path/to/dgstack.livecode" into tDataA
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Getting datagrid content from other stack in Standalone

Matthias Rebbe via use-livecode
If the script of an object is running, the stack it belongs to is open. If you reference an object in a closed stack (correct me if I am wrong) LC will load the stack the object belongs to into memory.

Bob S


> On Jan 12, 2018, at 08:54 , Mike Bonner via use-livecode <[hidden email]> wrote:
>
> Would this work with a stack on disk that hasn't been opened yet?


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Getting datagrid content from other stack in Standalone

Matthias Rebbe via use-livecode
In reply to this post by Matthias Rebbe via use-livecode
The last one is possible. As far as substacks getting moved and breaking references, the Standalone Builder takes that into account I believe. Also, if the stack files are contained in the folder the SB creates for them, I *believe* that the engine will upon failing to find a stack reference, check that folder, otherwise the SB would have to change the references in the code wherever it found them, and that wouldn't account for stack paths stored as properties. I'm pretty sure the engine resolves those things on the fly.

Bob S


> On Jan 12, 2018, at 08:54 , Mike Bonner via use-livecode <[hidden email]> wrote:
>
> Oh, as to the OP, my first thought on why it wasn't working, is that the
> stack wasn't open (hence the need to address it's on disk location), but
> another thought occurred to me.  I'm wondering if the standalone auto
> inclusions can be affected by moving substacks into separate stackfiles
> Perhaps the datagrid support libraries aren't being included?


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode