LC can drive you nuts

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: LC can drive you nuts

Post by dunbarx » Fri Apr 23, 2021 10:21 pm

Richard.

As I said I have a simple test stack that works the way I would expect it to. Therefore of no value at all.

I have no problem sending you the project I am working on. I can instruct how to demonstrate the problem, which is simple and straightforward, but I would not wish trying to dig into the guts of the thing on anyone.

Assuming it is not some edge case bug in LC, I do not know if my issue is of general interest to anyone but me, Currently I pre-open the substack but keep it hidden until the handler that is actually intended to open it runs. I mentioned that the fact the subStack is already open allows the mainStack process to proceed normally.

If anything, that workaround makes me think it is not something I did, but rather something in LC itself.

I do not really have confidence in that last statement. :wink: Anyway, what to do?

Craig

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: LC can drive you nuts

Post by mwieder » Sat Apr 24, 2021 12:58 am

Craig-

Is "stack" your mainstack or one of the substacks?
And what substack is that closeStackRequest handler in?

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: LC can drive you nuts

Post by sturgis » Sat Apr 24, 2021 1:30 am

I've run into similar in the past. At the time, it seemed to me that a script managed to get into a "thinks its compiled, but its really not" state. I seem to recall having a recipe to make it happen, but its been a while, and i'm foggy enough to be almost useless anymore. However. If it happens again, go into the offending script. Change SOMETHING. Almost anything, as long as it turns on the dirty bit. Compile, and test. I think it may be the same issue since commenting stuff out (the "SOMETHING" part) makes it work, then changing it back, compile, it continues to work.

Hi all. Yes, I still exist. Hope everyone is doing well.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: LC can drive you nuts

Post by mwieder » Sat Apr 24, 2021 1:34 am

Hey! Good to see you here again.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: LC can drive you nuts

Post by sturgis » Sat Apr 24, 2021 1:40 am

Hey Mark. Good to dip the toes in the lc pool again. :) Things have been a bit on the difficult side of life, so I'm here to seek distraction. How are you? And your better half? (ok so maybe this isn't the place, but it is truly great to be able to say hi to good people)

SparkOut
Posts: 2834
Joined: Sun Sep 23, 2007 4:58 pm

Re: LC can drive you nuts

Post by SparkOut » Sat Apr 24, 2021 9:05 am

Welcome back!

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: LC can drive you nuts

Post by dunbarx » Sat Apr 24, 2021 2:26 pm

Mark.

- A mainStack button handler does some stuff, navigates to the subStack with a "go" command, then does more stuff.

- The destination subStack contains the "closeStackRequest" handler in its stack script.

- The simple existence of the "closeStackRequest" handler halts the mainStack handler at the "go" command. Commenting it out allows the mainStack handler to finish.

The "closeStackRequest" handler never fires. How does the subStack know it is there at all? I assume that the act of moving from one stack to the other is the critical change in the overall set-up. This is something that normally has to be considered, since the topStack has changed. I just do not know how the presence of a handler in the target subStack, that never comes into play, stops execution of the mainStack handler.

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: LC can drive you nuts

Post by jacque » Sat Apr 24, 2021 6:47 pm

CloseStackRequest prevents the stack from closing unless the message is passed. I don't know why this would prevent another handler from completing but it may be that it operates by exiting to top. An experiment would be to pass the message at the end of the CloseStackRequest handler.

That doesn't explain why it interferes in the first place though.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: LC can drive you nuts

Post by dunbarx » Sat Apr 24, 2021 7:15 pm

Jacque

Thanks, but I tried that.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9801
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: LC can drive you nuts

Post by FourthWorld » Sat Apr 24, 2021 7:26 pm

Does your script "go" in the same window?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: LC can drive you nuts

Post by mwieder » Sat Apr 24, 2021 7:56 pm

Craig-

If there is an error anywhere in your substack script then it will be uncompiled. And your breakpoint will therefore never be triggered.
In your script editor Options, do you have "Live Errors" checked?

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: LC can drive you nuts

Post by jacque » Sat Apr 24, 2021 8:58 pm

What does "live errors" do? I can't find any documentation about it. I turned it on anyway.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: LC can drive you nuts

Post by mwieder » Sat Apr 24, 2021 9:12 pm

I don't know if there is any documentation on it.
I unchecked it and found that it didn't flag errors in my typing.
After checking it the x in the little red circle caught errors as I typed and the Errors tab showed the error text.
Most importantly, though, with it unchecked I could Apply the script even with unseen errors.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: LC can drive you nuts

Post by dunbarx » Sat Apr 24, 2021 9:39 pm

All.

Interesting takes, thanks. But remember that if the subStack is already open, I have no issues at all. In fact, I never would have known there was a problem. It cannot be a hidden uncompiled handler; such a thing does not fix itself by virtue of being opened in a different handler than the one that fails.

The mainStack handler quits right after the "go" line. A breakpoint right after that one never fires.

That is my workaround; I always open the subStack early, whether or not I will ever particularly need it. Then all is well. It used to be that all was well regardless, but a while ago it began just not to be.

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: LC can drive you nuts

Post by dunbarx » Sat Apr 24, 2021 9:45 pm

Richard.

The subStack opens in its own window, placed right next to the mainStack.

Craig

Post Reply

Return to “Talking LiveCode”