A debugger too obedient

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: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Fermin
Posts: 149
Joined: Fri Jun 05, 2015 10:44 pm

A debugger too obedient

Post by Fermin » Mon Jun 13, 2016 12:34 am

Lets suppose I have a list field with multiple lines, p. eg.

RINGO
GEORGE
JOHN
PAUL

And his his script is:

on mouseup
    put the selectedtext into theSel
end mouseup

Well. Now, to check its operation, I put a breakpoint at the beginning of the code (on mouse up)

If I go to the field and click, p. eg. the second line, the debugguer is activated and when it reaches the end (end mouseUp), the variable theSel does not show 'GEORGE' as is expected.
What it shows is: "put the selectedtext into theSel".

Curious! I guess it's because the LiveCode debugguer had just select this line as a visual aid for monitoring debug.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: A debugger too obedient

Post by bn » Mon Jun 13, 2016 12:52 am

Hi Fermin,

if you code

Code: Select all

put the selectedtext of me into theSel
then the debugger shows "George".

The unspecified selectedText is any selectedText at the moment. In this special case line 2 of the ScriptEditor

you can see the difference when you step through this code

Code: Select all

on mouseup
   put the selectedText of me into tRealSelection
   put the selectedtext into theSel
   put the selectedText into tCurrentSelection
end mouseup
I would not think it is a bug because that is the way selectedText works. Others may differ on this.

Kind regards
Bernd

Fermin
Posts: 149
Joined: Fri Jun 05, 2015 10:44 pm

Re: A debugger too obedient

Post by Fermin » Mon Jun 13, 2016 8:48 am

Thank you, Bernd. Now I see it's not a bug, but the correct way the debugger works .
The words "of me" are key.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10330
Joined: Wed May 06, 2009 2:28 pm

Re: A debugger too obedient

Post by dunbarx » Mon Jun 13, 2016 3:18 pm

You have to remember that all IDE elements are simply ordinary stacks. If the debugger has focus, it may insinuate itself into your (ongoing?) processes. I got caught in this way just recently, and also thought it was a bug.

Craig Newman

Post Reply