Bad, bad broken SE

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: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Bad, bad broken SE

Post by dunbarx » Mon Mar 07, 2022 6:01 pm

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

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

Re: Bad, bad broken SE

Post by dunbarx » Mon Mar 07, 2022 6:18 pm

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
Last edited by dunbarx on Mon Mar 07, 2022 6:34 pm, edited 1 time in total.

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

Re: Bad, bad broken SE

Post by dunbarx » Mon Mar 07, 2022 6:34 pm

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

RCozens
Posts: 138
Joined: Thu Aug 05, 2021 6:42 am
Location: Manchester, CA USA

Re: Bad, bad broken SE

Post by RCozens » Mon Mar 07, 2022 6:37 pm

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!
Rob Cozens dba Serendipity Software Company
Manchester, CA USA

Each new generation gives more attention to the man-made world...
and less attention to the world that made man.

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

Re: Bad, bad broken SE

Post by dunbarx » Mon Mar 07, 2022 7:50 pm

Confirming Crag's post.
Hi.

I not sure I am happy about this. It means there is something bigger going on,

Craig

RCozens
Posts: 138
Joined: Thu Aug 05, 2021 6:42 am
Location: Manchester, CA USA

Re: Bad, bad broken SE

Post by RCozens » Tue Mar 08, 2022 5:59 pm


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

Rob Cozens dba Serendipity Software Company
Manchester, CA USA

Each new generation gives more attention to the man-made world...
and less attention to the world that made man.

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

Re: Bad, bad broken SE

Post by dunbarx » Tue Mar 08, 2022 6:01 pm

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

RCozens
Posts: 138
Joined: Thu Aug 05, 2021 6:42 am
Location: Manchester, CA USA

Re: Bad, bad broken SE

Post by RCozens » Tue Mar 08, 2022 8:06 pm

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
Rob Cozens dba Serendipity Software Company
Manchester, CA USA

Each new generation gives more attention to the man-made world...
and less attention to the world that made man.

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

Re: Bad, bad broken SE

Post by dunbarx » Tue Mar 08, 2022 8:34 pm

Bob.

I never understand my results.

Craig

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

Re: Bad, bad broken SE

Post by jacque » Tue Mar 08, 2022 8:43 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: Bad, bad broken SE

Post by dunbarx » Tue Mar 08, 2022 9:56 pm

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

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

Re: Bad, bad broken SE

Post by jacque » Wed Mar 09, 2022 12:25 am

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: Bad, bad broken SE

Post by dunbarx » Wed Mar 09, 2022 4:00 pm

Jacque.

9.6.1. You know its a Mac.

Craig

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

Re: Bad, bad broken SE

Post by jacque » Wed Mar 09, 2022 6:28 pm

Try 9.6.4 maybe.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

RCozens
Posts: 138
Joined: Thu Aug 05, 2021 6:42 am
Location: Manchester, CA USA

Re: Bad, bad broken SE

Post by RCozens » Wed Mar 09, 2022 8:05 pm

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??
Rob Cozens dba Serendipity Software Company
Manchester, CA USA

Each new generation gives more attention to the man-made world...
and less attention to the world that made man.

Post Reply

Return to “Talking LiveCode”