openstack or preopenstack confusing to new application builders

Richard Gaskin ambassador at fourthworld.com
Sun Nov 8 16:43:30 EST 2009


william humphrey wrote:
> I am posting this just for other newbies out there who may find this
> confusing. If you have a mainstack and lots of substacks and you put either
> a preopenstack or an openstack in the mainstack you would think that it
> would only be called when you first open your stack. Not true. It is called
> every time you switch to any of the other substacks of your main stack. I
> have solved this by using GLX framework and the special on
> glxapp_initializeApplication
> which does what I thought pre-openstack should do. It runs just once when
> you first open your stack (or application) and then it is never called
> again. I have no idea how to do this with RunRev normally. For example when
> I initialize my database I've found that it is a bad idea to do it in either
> peropenstack or openstack as it gets called again and again when you switch
> to other substacks and back again. I found that really confusing and just
> put my openstack stuff in a button that I could push when the stack first

The startup message is a good option for things that need to happen when 
the standalone starts up.

But preOpenStack is easy to deal with if you put your preOpenStack 
handler in the card script of the mainstack.  That way it only fires 
when that mainstack is opened, but isn't triggered by the opening of any 
substacks.

--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv



More information about the use-livecode mailing list