Simple open stack causes an error

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Simple open stack causes an error

Post by gyroscope » Wed May 07, 2008 2:42 am

Hi, the following handler:

on mouseUp
open Stack "SuchandSuch"
end mouseUp

...causes an error message, all of a sudden.

Any help/comments greatly appreciated, thank you.
Last edited by gyroscope on Thu May 08, 2008 11:58 am, edited 3 times in total.

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Wed May 07, 2008 2:50 pm

Hi, my guess is that this me-newbie-Rev-twistup hasn't occured to many people at all, mainly because I'm sure the majority plan their stack/substack system well in advance (unlike me).

I've started the project from scratch, so fingers crossed things should work out this time,...

:)
Last edited by gyroscope on Thu May 08, 2008 12:00 pm, edited 1 time in total.

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Wed May 07, 2008 11:38 pm

Hi, my mistake/misunderstanding all along...

I had put an on openStack handler in the main stack, and using a beep and answer test, realised that the openStack message applies to any substacks as well...I live and learn!

So a question please: How do I write an openStack handler just for the main stack only, ignoring all substacks?

(i.e on openStack "This Stack Only"
-- set global variables ,etc initial values only
--and other first time, only time, stuff for main stack only
-- without resorting to a preferences file
end openStack)

The above using openStack "Main stack only please!" doesn't seem to work and still runs when other substacks are opened.

Thank you!

:)

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Thu May 08, 2008 3:07 pm

OK, I think I've tracked it down what I need to use now:
start using and stackInUse should do the trick when I've experimented with them...I think....

Thank you for your interest anyhow. Best regards all.

:)

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Fri May 09, 2008 11:20 pm

Hi, if any newcomer to the Rev language (like me) encounters this prob and can't get start using and StackInUse to work (like I can't :wink:), there's an easy workaround (perhaps not as refined, but it works!)

If you use on PreOpenStack, OpenStack or CloseStack in your main stack, in any other sub-stacks, put the matching handlers as empty, i.e

on preOpenStack

end preOpenStack

Hope that's useful for someone, sometime!

:)

Post Reply