Opening a substack

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Opening a substack

Post by richmond62 »

Why does this:

Code: Select all

on mouseUp
open stack "Dia"
end mouseUp
while opening the substack "Dia", also throw a 'bluey'?
-
SShot 2023-02-13 at 22.29.42.png
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: Opening a substack

Post by richmond62 »

And, by-the-by: this has happened both on MacOS 10.7.5 with LC 8.1.10 and on MacOS 13.2.1 with LC 9.6.3.
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10507
Joined: Wed May 06, 2009 2:28 pm

Re: Opening a substack

Post by dunbarx »

Is there such a stack? I open (or go to) stacks all the time. I bet you do as well.

Does this not throw en error?

Code: Select all

on mouseUp
if there is a stack "dia" then open stack "Dia"
end mouseUp
Craig
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10507
Joined: Wed May 06, 2009 2:28 pm

Re: Opening a substack

Post by dunbarx »

Richmond.

It just occurred to me. If the stack is not in memory, you must specify a file path to wherever it lives.

Craig
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: Opening a substack

Post by richmond62 »

The substack, 'Dia', is a substack of the mainstack, so, according to the documentation, thè stack should open (which it does) and not throw up an error message.

There is NO error in the script.
stam
Posts: 3214
Joined: Sun Jun 04, 2006 9:39 pm

Re: Opening a substack

Post by stam »

I open substacks this way all the time with no issues whatsoever.

On the other hand, I often find that exceptions raised are often ether not entirely accurate or too vague to be of use, so the actual error report isn't always that helpful. For example if something is crashing with geometry manager, you get completely nonsense errors (or no error but it crashes).

Might there be an open/preOpen stack/card handler in the substack that is causing the error? Or something else in the substack?

To test it why don't you try creating a new empty substack and repeat the process? I'd wager you do not see this problem with a new empty substack.

S.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: Opening a substack

Post by richmond62 »

I am sure it was a script in the substack: having modified that
there have been no further problems.

I does say something about the standard of error reporting, though.
stam
Posts: 3214
Joined: Sun Jun 04, 2006 9:39 pm

Re: Opening a substack

Post by stam »

It’s a known issue and one I think they plan to address with the engine change that will allow compiled scripts…
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: Opening a substack

Post by richmond62 »

they plan to address
One of the many reasons I backed the Open Source initiative . . .

https://www.kickstarter.com/projects/17 ... escription
Post Reply