Stacks and Standalones

Jim Bufalini jim at visitrieve.com
Tue Mar 9 13:07:53 EST 2010


Andrew Kluthe wrote:

> I am trying to package up a little preview of my app so far for my boss
> and
> am running into a few large snags.
> 
> Saving as a stand alone (with all the guides I have been following)
> mangles
> the program and it crashes.
> Stack runner 2.0 runs the program mostly fine but it cannot find
> substacks
> to my Main.rev.
> 
> Main.rev has several substacks "TopMenu" being one of them, but stack
> runner
> produces this revError
> Executing at 10:36:21 AM on Tuesday, March 9, 2010
> Type: Chunk: can't find stack
> Object: card id 1002 of stack "TopMenu" of stack "C:/Rev/FOM2/main.rev"
> Line: put (the height of stack sMainStack + 30) + (the height of stack
> "TopMenu" + 30) + (the height of stack "Help" + 30) into sReportHeight
> Line Num: 4
> Hint: buddy
> 
> I am a little confused on how to refer to stacks/files/etc within rev.
> My
> program works fine within the IDE but is nearly totally broken no
> matter
> what stand alone solution I use.
> 
> The layout of my app is as follows:
> 
> Main.Rev has substacks --> "Calendar", "Help", "libSQLYoga", "Reports",
> "Resources", "SideMenu", "TopMenu"
> 
> 
> LeaseStack.rev has substacks --> "Edit Fields", "Edit Lease", "Edit
> Payments"
> 
> 
> Setup.rev has substacks --> "People Setup"
> 
> How would I refer to "TopMenu"? Currently it is 'stack "TopMenu"'.
> How would I refer to "Edit Fields" of LeaseStack.rev from withing
> main.rev?
> currently its stack "LeaseStack"
> 
> Surely my stand alone problems have to do with my code because they are
> so
> universal to all the solutions I have tried.
> 
> Any help or direction you could provide would be fantastic. If I need
> to
> clarify at all, please let me know.

In the IDE, you have probably been manually opening Main.rev and then
LeaseStack.rev and then Setup.rev and everything works.

Understand that a standalone is essentially one stack (and its substacks).
That one stack that you build into a standalone then has to do what you have
been doing manually, which is open the other stacks.

So assuming main.rev is your main stack that you are making into a
standalone, in the preOpenStack handler of main.rev, you need to *go
invisible stack "LeaseStack"* and *go invisible stack "Setup"* This will
open the other two stacks without displaying them on the screen.

For this to work, the two stacks (LeaseStack and Setup) need to be in the
same folder as your standalone. When you launch your standalone, the
defaultFolder is set to the folder that contains the standalone and this is
where rev will, by default, look for the other main stacks to open.

When you open a stack like LeaseStack, its substacks are automatically
opened. So once you open the other two main stacks, then everything will
work like it does now in the IDE.

There are many variations on what I've said above, but essentially you need
to make sure all of your stacks are open before you can address them.

Aloha from Hawaii,

Jim Bufalini





More information about the use-livecode mailing list