Newbie - MainStack Question

Richard Gaskin ambassador at fourthworld.com
Sat Jul 26 12:55:00 EDT 2003


Brian K. Maher wrote:

> I am trying to understand the best way to design a database
> application using Revolution.
> 
> I have noticed that handlers in the main stack (i.e. in the Stack
> script) are automatically seen by all sub stacks.
> 
> For example, an openStack handler in the main stack will be invoked
> when a sub stack opens and has no openStack handler of its own.
> 
> This is leading me to question whether I should (or want to) use the
> main stack for anything other than generic handlers that my
> application needs.  I am thinking about simply making the main stack
> invisible and using only sub stacks for my applications windows.
> 
> Can anyone give me any insights on this?  Am I missing something here?

I tend to put handlers specific to the mainStack in the script of the
mainStack's card, leaving its stack script for use as a common library as
you suggest.  

Having the mainstack invisible is not a bad idea.  I usually have my
mainstack consist only of a memory error warning, hiding that stack at the
end of the preOpenStack handler in its card script.  This way if the boot
sequence is completed successfully it's never seen, and any errors go
through my own error handling -- except those cases in which something
prevents even my error-catching from working, which is often related to
memory issues (almost any other type of error will at least retain the
ability to present an error dialog); in those cases the program is left
hanging, but at least the user has some relevant information.

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Developer of WebMerge 2.2: Publish any database on any site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc




More information about the use-livecode mailing list