Page 1 of 2
Bad, bad broken SE
Posted: Mon Mar 07, 2022 6:01 pm
by dunbarx
You all know how much I love LC.
Today in the normal course of doing stuff, I had a variable, "boardMix", which contained "20 8 8 4", four integers separated by spaces. The following line was in a handler:
Code: Select all
replace space with "," in boardmix
stepping through, I spent an hour trying to find out why, in the SE window, the variable did not change. Nothing I did made any difference.
Just for laughs, I double-clicked the variable to see what it looked like in its own window. Everything there was fine, and likely always was. Quitting and reopening LC made no difference.
This is really not fair.
I am posting this just before I restart the machine itself. Watch this space...
Craig
Re: Bad, bad broken SE
Posted: Mon Mar 07, 2022 6:18 pm
by dunbarx
Restarting did not change anything.
So LC does what it should to its variables, but while stepping through, the one shown in the SE itself is wrong, whereas its representation in its own window is correct. This had better just go away soon, in the same manner as it appeared.
Craig
Re: Bad, bad broken SE
Posted: Mon Mar 07, 2022 6:34 pm
by dunbarx
Well, in a new stack with:
Code: Select all
on mouseUp
put "A B C D" into temp -- spaces
replace space with comma in temp
breakpoint
end mouseUp
The SE does its thing correctly. I guess I am relieved.
The original variable "boardList" is actually a global. The handler is actually a function handler called from afar. If I substitute any other variable name in that handler, the SE shows the comma replacement directly. In a new stack, it does not matter if the variable is global or not. So it is something in my project itself that is causing the issue, but only in THIS handler, and for THIS variable string. I can fix this by simply changing the passed parameter to the function, but wonder why that string of chars determines the peculiar action of the SE.
Craig
Re: Bad, bad broken SE
Posted: Mon Mar 07, 2022 6:37 pm
by RCozens
Hi All,
Confirming Crag's post.
Code: Select all
on mouseUp
put "20"&space&"8"&space&"8"&space&"4" into dunbarsString
answer dunbarsString
replace space with "." in dunbarsString
answer dunbarsString
end mouseUp
breakpoints set at each answer statement produce the error he described in Rev 9.6.2 running under Windows 10.
Cheers!
Re: Bad, bad broken SE
Posted: Mon Mar 07, 2022 7:50 pm
by dunbarx
Confirming Crag's post.
Hi.
I not sure I am happy about this. It means there is something bigger going on,
Craig
Re: Bad, bad broken SE
Posted: Tue Mar 08, 2022 5:59 pm
by RCozens
It means there is something bigger going on,
Perhaps the SE is not recognizing the need to update the data representation when processing the replace command:
If you step through this code you will see the value updated.
Code: Select all
on mouseUp
put "20"&space&"8"&space&"8"&space&"4" into dunbarsString
answer dunbarsString
put "." into char 3 of dunbarsString
put "." into char 5 of dunbarsString
put "." into char 7 of dunbarsString
answer dunbarsString
end mouseUp
Re: Bad, bad broken SE
Posted: Tue Mar 08, 2022 6:01 pm
by dunbarx
Rob.
Yep, and all that works fine when stepping through. It is not the first time I, and others, have noticed that some handlers work fine when debugging, but not when running normally.
Oddly, as I said, changing the actual string itself fixed the issue. That should NOT happen, but it did.
Craig
Re: Bad, bad broken SE
Posted: Tue Mar 08, 2022 8:06 pm
by RCozens
Craig,
I've played with this some more, and I'm not understanding my results.
I will look into this later, when I have more time, and report back.
Rob
Re: Bad, bad broken SE
Posted: Tue Mar 08, 2022 8:34 pm
by dunbarx
Bob.
I never understand my results.
Craig
Re: Bad, bad broken SE
Posted: Tue Mar 08, 2022 8:43 pm
by jacque
RCozens wrote: ↑Mon Mar 07, 2022 6:37 pm
Code: Select all
on mouseUp
put "20"&space&"8"&space&"8"&space&"4" into dunbarsString
answer dunbarsString
replace space with "." in dunbarsString
answer dunbarsString
end mouseUp
breakpoints set at each answer statement produce the error he described in Rev 9.6.2 running under Windows 10.
I ran this in LC 9.6.6 on Mac and didn't see any problem. The variable list updated correctly.
Re: Bad, bad broken SE
Posted: Tue Mar 08, 2022 9:56 pm
by dunbarx
Jacque.
I am used to intermittent issues.
This one is odd in that I can fix it simply by changing the name of the variable in the called function handler. I was wondering if the fact that the variable was global made a difference. It ought not to, and doesn't, as I proved in a test stack. And of course no other variable acts the same way in the fairly large and complex stack I work in regularly.
Craig
Re: Bad, bad broken SE
Posted: Wed Mar 09, 2022 12:25 am
by jacque
What version of LC are you running? I just had a weird SE issue LC 9.6.6 that required me to relaunch LC. The wrong scripts were loading into the editor, and it hung for 10-20 seconds while trying to type. That was a Windows problem but I've never seen it before on Mac. Restarting LC has fixed it, for now at least.
Re: Bad, bad broken SE
Posted: Wed Mar 09, 2022 4:00 pm
by dunbarx
Jacque.
9.6.1. You know its a Mac.
Craig
Re: Bad, bad broken SE
Posted: Wed Mar 09, 2022 6:28 pm
by jacque
Try 9.6.4 maybe.
Re: Bad, bad broken SE
Posted: Wed Mar 09, 2022 8:05 pm
by RCozens
RCozens wrote: ↑Tue Mar 08, 2022 8:06 pm
I've played with this some more, and I'm not understanding my results.
Craig, et al:
I am still not understanding my results, because yesterday and today I cannot duplicate the result I originally reported...even with the script I originally posted.
I have changed the name of the string to "boardMix", made it a global instead of a local variable and placed the replace command in a function; but the SE now shows the replace command working as it should.
Curiouser and curiouser??