stackfiles

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

stackfiles

Skip Kimpel via use-livecode
Hi friends,

quick question:
When I "start using stack xyz" then all stack can access the scripts etc.
of stack xyz. Does this also apply to the stackfiles of stack xyz?

Thanks in advance!


Best

Klaus
--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
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: stackfiles

Skip Kimpel via use-livecode
Start Using simply inserts the script of that stack in the back, so it is now in the message path which is global to everything running in that instance of livecode or the standalone.

Bob S


> On Aug 9, 2018, at 02:58 , Klaus major-k via use-livecode <[hidden email]> wrote:
>
> Hi friends,
>
> quick question:
> When I "start using stack xyz" then all stack can access the scripts etc.
> of stack xyz. Does this also apply to the stackfiles of stack xyz?
>
> Thanks in advance!
>
>
> Best
>
> Klaus
> --
> Klaus Major
> http://www.major-k.de
> [hidden email]


_______________________________________________
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: stackfiles

Skip Kimpel via use-livecode
Hi Bob,

> Am 09.08.2018 um 16:48 schrieb Bob Sneidar via use-livecode <[hidden email]>:
>
> Start Using simply inserts the script of that stack in the back, so it is now in the message path which
> is global to everything running in that instance of livecode or the standalone.

yes, I know, this way it also lets other stacks us the "used" stacks external etc, but does this apply to STACKFILES, too?
That was my question!

> Bob S
>
>> On Aug 9, 2018, at 02:58 , Klaus major-k via use-livecode <[hidden email]> wrote:
>>
>> Hi friends,
>>
>> quick question:
>> When I "start using stack xyz" then all stack can access the scripts etc.
>> of stack xyz. Does this also apply to the stackfiles of stack xyz?

Best

Klaus

--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
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: stackfiles

Skip Kimpel via use-livecode
I see, you are asking if the scripts of the stackfiles are inserted into the message heirarchy? No. It can't work that way if you think about it. You would never be able to include another stack in a standalone without having every stack script of every stack in the message heirarchy.

If you are asking if the the script of stack xys is accessible to the stack files however, then yes of course. If you are asking something else I cannot discern what it is.

To my understanding, the stackfiles property simply makes it possible to reference stacks by their short names without having to reference their full paths when opening them. Also, when building a standalone, they will be included automatically.

Bob S


> On Aug 9, 2018, at 07:53 , Klaus major-k via use-livecode <[hidden email]> wrote:
>
> Hi Bob,
>
>> Am 09.08.2018 um 16:48 schrieb Bob Sneidar via use-livecode <[hidden email]>:
>>
>> Start Using simply inserts the script of that stack in the back, so it is now in the message path which
>> is global to everything running in that instance of livecode or the standalone.
>
> yes, I know, this way it also lets other stacks us the "used" stacks external etc, but does this apply to STACKFILES, too?
> That was my question!
>


_______________________________________________
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: stackfiles

Skip Kimpel via use-livecode
Hi Bob,

> Am 09.08.2018 um 17:03 schrieb Bob Sneidar via use-livecode <[hidden email]>:
>
> I see, you are asking if the scripts of the stackfiles are inserted into the message heirarchy? No. It can't work that way if you think about it. You would never be able to include another stack in a standalone without having every stack script of every stack in the message heirarchy.

that's not not what I meant.

> If you are asking if the the script of stack xys is accessible to the stack files however, then yes of course.

Not what I meant, I knew this before. 8-)

> If you are asking something else I cannot discern what it is.

I mean if stack xyz has its stackfile property set, can other stack access this property just like the stack xyz scripts?

> Bob S
>
>
>> On Aug 9, 2018, at 07:53 , Klaus major-k via use-livecode <[hidden email]> wrote:
>>
>> Hi Bob,
>>
>>> Am 09.08.2018 um 16:48 schrieb Bob Sneidar via use-livecode <[hidden email]>:
>>>
>>> Start Using simply inserts the script of that stack in the back, so it is now in the message path which
>>> is global to everything running in that instance of livecode or the standalone.
>>
>> yes, I know, this way it also lets other stacks us the "used" stacks external etc, but does this apply to STACKFILES, too?
>> That was my question!

Best

Klaus

--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
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: stackfiles

Skip Kimpel via use-livecode


> On Aug 9, 2018, at 08:07 , Klaus major-k via use-livecode <[hidden email]> wrote:
>
> I mean if stack xyz has its stackfile property set, can other stack access this property just like the stack xyz scripts?

If I understand you, then another stack can reference the stackfiles of xyz by getting the stackfiles of stack xyz. But I cannot think that is what you meant. The stackfiles is a property of a single stack, and not a global property.

But I probably still do not understand. :-)

Bob S


_______________________________________________
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: stackfiles

Skip Kimpel via use-livecode
Hi Bob,

> Am 09.08.2018 um 17:15 schrieb Bob Sneidar via use-livecode <[hidden email]>:
>
>> On Aug 9, 2018, at 08:07 , Klaus major-k via use-livecode <[hidden email]> wrote:
>>
>> I mean if stack xyz has its stackfile property set, can other stack access this property just like the stack xyz scripts?
>
> If I understand you, then another stack can reference the stackfiles of xyz by getting the stackfiles of stack xyz.

Ok, that my be one solution to my questions.

> But I cannot think that is what you meant. The stackfiles is a property of a single stack, and not a global property.

Well, so are the xternals and scripts of a stack, but other stack can use these if we "start using stack xyz".
And that fact led me to the conclusion that this may also apply to "the stackfiles" of stack xyz, which was my original question :-D
>
> But I probably still do not understand. :-)
>
> Bob S

Best

Klaus

--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
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: stackfiles

Skip Kimpel via use-livecode
In reply to this post by Skip Kimpel via use-livecode
Klaus major-k wrote:

 > I mean if stack xyz has its stackfile property set, can other stack
 > access this property just like the stack xyz scripts?

Every property of every object in every stack on your hard drive is
available to every script.

An object does no need to be loaded into memory to be accessed.  If you
query a property of an object in an unopened stack, the engine will
faithfully read the stack and unpack it to return what you're requesting.

If the stack is already in memory, you can refer to it by short name.

   get the width of btn 1 of stack "MyStack"

In memory or not, you can refer to a stack by its filename:

   get the width of btn 1 of stack "/home/klaus/MyStack.livecode"

When a stack file is included among the stackfiles property of an open
stack, you should be able to address it by short name if you like.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
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: stackfiles

Skip Kimpel via use-livecode
Hi Richard,

> Am 09.08.2018 um 17:20 schrieb Richard Gaskin via use-livecode <[hidden email]>:
>
> Klaus major-k wrote:
> ...
> When a stack file is included among the stackfiles property of an open stack, you should be able to address it by short name if you like.

thank you, that finally answers my question. 8-)

> --
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> [hidden email]                http://www.FourthWorld.com

Best

Klaus

--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
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: stackfiles

Skip Kimpel via use-livecode
Ah! I get it now.

I tested this. 2 stacks, one with the stackfiles set to a third stack somewhere on disk. Second one with a button that opens the stack listed in the stackfiles of the first stack using it's short name.

With both stacks open, Clicking the button opens the stack listed in the stackfiles of the first stack. With only the second stack open, I get a script error.

So, yes!

Bob S


> On Aug 9, 2018, at 08:55 , Klaus major-k via use-livecode <[hidden email]> wrote:
>
> Hi Richard,
>
>> Am 09.08.2018 um 17:20 schrieb Richard Gaskin via use-livecode <[hidden email]>:
>>
>> Klaus major-k wrote:
>> ...
>> When a stack file is included among the stackfiles property of an open stack, you should be able to address it by short name if you like.
>
> thank you, that finally answers my question. 8-)
>
>> --
>> Richard Gaskin
>> Fourth World Systems
>> Software Design and Development for the Desktop, Mobile, and the Web


_______________________________________________
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: stackfiles

Skip Kimpel via use-livecode
How odd though. The stackfiles is acting like a global property. Imagine I have 2 projects open, each referencing 2 different versions of the same stack in different locations on the disk. Any attempt to open that stack using it's short name might yield the wrong stack.

I know you will say: "Well then, don't do that!" But lets say you have a splash stack you use in multiple projects, or a custom dialog stack. You make changes to one stack requiring an update to the other, but that would require that you update ALL the stacks that use the other stack. Rather than do that you might simply save a new version of the splash or dialog stack until you can get around to updating and testing the others.

Bob S


> On Aug 9, 2018, at 09:06 , Bob Sneidar via use-livecode <[hidden email]> wrote:
>
> Ah! I get it now.
>
> I tested this. 2 stacks, one with the stackfiles set to a third stack somewhere on disk. Second one with a button that opens the stack listed in the stackfiles of the first stack using it's short name.
>
> With both stacks open, Clicking the button opens the stack listed in the stackfiles of the first stack. With only the second stack open, I get a script error.
>
> So, yes!
>
> Bob S


_______________________________________________
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: stackfiles

Skip Kimpel via use-livecode
The safe way then to do this would be:

put the stackfiles of stack "test1" into tStackFiles -- or whatever your stack is named
filter lines of tStackFiles with "splash*" -- or whatever your stack short name is
put item 2 of tStackFiles into tFullStackPath
open tFullStackPath

Bob S


> On Aug 9, 2018, at 09:17 , Bob Sneidar via use-livecode <[hidden email]> wrote:
>
> How odd though. The stackfiles is acting like a global property. Imagine I have 2 projects open, each referencing 2 different versions of the same stack in different locations on the disk. Any attempt to open that stack using it's short name might yield the wrong stack.
>
> I know you will say: "Well then, don't do that!" But lets say you have a splash stack you use in multiple projects, or a custom dialog stack. You make changes to one stack requiring an update to the other, but that would require that you update ALL the stacks that use the other stack. Rather than do that you might simply save a new version of the splash or dialog stack until you can get around to updating and testing the others.
>
> Bob S


_______________________________________________
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: stackfiles

Skip Kimpel via use-livecode
Should be:
open stack tFullStackPath


> On Aug 9, 2018, at 09:23 , Bob Sneidar via use-livecode <[hidden email]> wrote:
>
> open tFullStackPath


_______________________________________________
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: stackfiles

Skip Kimpel via use-livecode
In reply to this post by Skip Kimpel via use-livecode
Bob Sneidar wrote:

 > How odd though. The stackfiles is acting like a global property.
 > Imagine I have 2 projects open, each referencing 2 different versions
 > of the same stack in different locations on the disk. Any attempt to
 > open that stack using it's short name might yield the wrong stack.

Yes, the stackFiles property is every bit as global as any other use of
stack names.

To handle different versions of a stack, I use different LC instances.

FWIW ever since v5 (maybe earlier?) LC's clipboard preserves objects
with complete fidelity even when pasting between instances, making the
task of working on both a breeze.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
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: stackfiles

Skip Kimpel via use-livecode
Not to belabor the point, but the stackfiles is a property of a STACK, not a global system property. It would be like setting the foo of stack "test1" to the filename of stack "splash", quitting LC, relaunching LC, opening stack "test1", then expecting to be able to open stack "splash" using it's short name. It's obvious that won't work, so you wouldn't expect the filenames property to make "splash" accessible simply by opening "test1".

But knowledge is power, and as long as we are all aware, it doesn't matter that much to me.

Bob S


> On Aug 9, 2018, at 11:45 , Richard Gaskin via use-livecode <[hidden email]> wrote:
>
> Bob Sneidar wrote:
>
> > How odd though. The stackfiles is acting like a global property.
> > Imagine I have 2 projects open, each referencing 2 different versions
> > of the same stack in different locations on the disk. Any attempt to
> > open that stack using it's short name might yield the wrong stack.
>
> Yes, the stackFiles property is every bit as global as any other use of stack names.


_______________________________________________
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: stackfiles

Skip Kimpel via use-livecode
Bob Sneidar wrote:

 > On Aug 9, 2018, at 11:45 , Richard Gaskin wrote:
 > Yes, the stackFiles property is every bit as global as any other use
 > of stack names.
 >
 > Not to belabor the point, but the stackfiles is a property of a STACK,
 > not a global system property.

A stack's name is also a property of a stack, but anything involving
stack names has global effects.

The stackFiles property allows us to use the short name of a stack file
to easily access that stack.

Once the stack with the stackFiles list is loaded, all those references
are loaded with it.  The same mechanism that allows scripts in that
stack to call other stacks by short name allow any other scripts
anywhere else to use that same name, because stack names have global
effects.

Besides, even if you had two stacks whose stackFiles had the same stack
short name assigned to different stackFiles, one of them wouldn't work
anyway because as soon as it tried you'd get a stack name conflict warning.

Simpler to just remember that stack names have global scope, then you
can plan accordingly with consistent simplicity.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
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: stackfiles

Skip Kimpel via use-livecode
Hi Richard.

I tested this. You don't get a conflict warning if the second stack attempts to open it's version of "splash" after the first stack had opened it's version. Instead, when the first stack has it's version of "splash" already opened, and the second stack tries to open it's "splash", LC simply goes to the "splash" the first stack already has open.

The only conflict warning I got was when I set the stackfiles of stack "test1" to one copy of "splash", then attempted to do the same thing with stack "test2" using a different copy of splash. I assume then that setting the stackfile propery actually opens the stackfile and leaves it open in memory. But subsequently opening either test stack will NOT automatically open their own stack files.

It may be that Linux or Windows is behaving differently.

So as I posted earlier, the only way to get around this, if you were so unwise as to have 2 versions of a stackfile floating around, would be to get the line of the stackfiles property for the stackfile you want to open, then use the full path, which is item 2 of the line. But then if the OTHER version of the stack file is open, THEN you would get the conflict.

Bob S

> On Aug 9, 2018, at 15:51 , Richard Gaskin via use-livecode <[hidden email]> wrote:
>
> Besides, even if you had two stacks whose stackFiles had the same stack short name assigned to different stackFiles, one of them wouldn't work anyway because as soon as it tried you'd get a stack name conflict warning.


_______________________________________________
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: stackfiles

Skip Kimpel via use-livecode
Bob Sneidar wrote:

 >> On Aug 9, 2018, at 15:51 , Richard Gaskin wrote:
 >>
 >> Besides, even if you had two stacks whose stackFiles had the same
 >> stack short name assigned to different stackFiles, one of them
 >> wouldn't work anyway because as soon as it tried you'd get a stack
 >> name conflict warning.
 >
 > I tested this. You don't get a conflict warning if the second stack
 > attempts to open it's version of "splash" after the first stack had
 > opened it's version. Instead, when the first stack has it's version of
 > "splash" already opened, and the second stack tries to open it's
 > "splash", LC simply goes to the "splash" the first stack already has
 > open.

Any confusion there is just clumsy writing on my part.  When I wrote
"wouldn't work anyway" I meant that if it did what you had originally
expected the stack name conflict would be the outcome.

As implemented, the stack name conflict is avoided because the
stackFiles assignments first brought into use take precedence over
anything later that would contradict them.


 > So as I posted earlier, the only way to get around this, if you were
 > so unwise as to have 2 versions of a stackfile floating around, would
 > be to get the line of the stackfiles property for the stackfile you
 > want to open, then use the full path, which is item 2 of the line. But
 > then if the OTHER version of the stack file is open, THEN you would
 > get the conflict.

Exactly. Stack names being global, any "solution" to this won't be much
of a solution at all, since the end result would be a stack name conflict.


Finding a true solution would depend on *why* you're working on multiple
stacks with the same name.

If it's to compare something with an older version, or copy something
from an older version into a new one, running the older version in a
second instance of LC is simple enough if you can spare a gig and a half
of disk space.  That gives you a completely separate namespace and
requires no special effort beyond copying your LC folder.

Diffing can be done cleanly and efficiently by reducing each stack to an
array and then comparing the arrays.  Converting a stack to LSON is a
relatively short script, and once on disk the LSON files have no
namespace restrictions so they can be easily manipulated within a single
LC instance however one likes.

And if you use script-only stacks you have the choice of opening them as
stacks or textual data, so working with two stacks as text is super easy
and requires no special handling, and can even be done in any text editor.

There are also the possibility of automating versioned saves with
appended stack names that include a unique time stamp, and many other
options.

Which of the many options is best for your circumstance will depend on
the "why".

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
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