Waiting for Godot

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

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

Waiting for Godot

Post by dunbarx » Tue May 25, 2021 3:49 pm

Well, "go", anyway.

I have three simple stacks, named "aa", "bb", and "cc". This is in the script of a button on stack "aa":

Code: Select all

on mouseup
   go stack "bb"
   --wait 1
   go  stack "cc"
   --wait 1
   go  stack "bb"
   --wait 1
   go  stack "cc"
end mouseup
I am left on stack "bb", not "cc". But if I uncomment the three "wait" commands, all works just fine. Odd, or expected?

Craig

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Waiting for Godot

Post by bogs » Mon Jun 07, 2021 9:11 am

You know, I had lost track of this which I meant to reply to, so I guess bot's are good for something after all hah.

Craig, here is what i think, I think it is "GO" ing to cc every time, however, when I was testing it without stepping through the debugger, I would see sometimes that "bb" was the active window, sometimes "cc" was the active window (about like flipping a quarter % wise).

Try adding this after the last line of code -

Code: Select all

   put the topStack
and the message box, instead of the focused titlebar, will tell you where you are. Now, as to why the window isn't focused properly all the time, well, that sounds like a bug or a delay from the OS. I'm betting on bug myself, but who knows for sure. The wait probably just gives it time to focus.

P.s. -- you also didn't mention if you made 3 main stacks 1 main stack and 2 sub-stacks, the above was tested as both setups.
Image

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

Re: Waiting for Godot

Post by dunbarx » Mon Jun 07, 2021 2:18 pm

Bogs.

Thanks for fooling around with this. It was three mainStacks

I had thought it was a "catching up" sort of thing. After all, sprinkling "wait 0 with messages" here and there is famous for solving such issues, giving little breathing room to the OS. I was just astonished that the LAST line was not executed, at least to the extent that the topStack appeared as I expected.

The funny thing is that I just tried this again with three new stacks, having thrown out the originals, and now stack "cc" appears as advertised.

Craig

Post Reply

Return to “Talking LiveCode”