Saving to a Stack

Klaus Major klaus at major-k.de
Sat Oct 18 09:24:00 EDT 2003


Hi Greg,

> ...
> In the mainstack  script I have;
>
> on preOpenStack
>   set the stackFiles of this stack to "DataCollector" -- is this 
> correct?

I guess not :-)

See below...

> end preOpenStack
>
> On a Mainstack  card with the field "Masterfield" I have a button with 
> the script; -- to put added data into the "Holder" field in the sub 
> stack "DataCollector".
>
> on mouseUp
>   put field "Masterfield" into field "Holder" of stack "DataCollector"
>   save stack "DataCollector"
> end mouseUp
>
> On the same card there is another button to update this field 
> "Masterfield" from the saved state of the substack.
>
> on mouseUp
>   put field "Holder" of stack "DataCollector" into field "Masterfield" 
> of this card
> end mouseUp
>
>
> This works fine in Rev but not as a standalone.
>
> When I build a Distribution I have checked "Automaticaly set 
> stackfiles on mainstack",

!!!

> "Move substacks into individual files" and "Create folder for sub 
> stacks" (data).

!!!

> I imagined that the substack, "DataCollector" would be put into the 
> "data" folder in this build - but it doesn't.
> Is this right?

Partly :-)

This is an OS X feature!

Please Control-click on the standalone in the finder and choose "Show 
contents" (or soemthing like that...)
and another folder will open. Standalones on OS X ARE folders in 
disguise ;-)

There you find another folder called "Contents".

Open it and you will have some files and 2 other folders...

Open the folder "MacOS" and there you will find "Revolution", which is 
the standalone and the
"missing" folder "data"...

Interesting, isn't it?!!! ;-)

> (Using Rev 2.0.2, Mac OSX)
>
> I am missing something I know, but don't now what.

It looks like you are overwriting the (correct) stackfiles-property 
that the
standalonebuilder has already set!

After moving substacks into a folder "data", the standalonebuilder sets 
the stackfiles to:

"data/DataCollector"

and your preopenstack-handler overwrites it with "DataCollector" 
again...

BUT there is no stack "DataCollector"!
Its "data/DataCollector" now!!!

> Thanks in advance.

I have not checked it by myself, but give it a try ;-)

> Greg

Hope that helps...


Regards

Klaus Major
klaus at major-k.de
www.major-k.de



More information about the Use-livecode mailing list