Red dot breakpoints not hit in resizeStack handler
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Red dot breakpoints not hit in resizeStack handler
Dear forum,
Has anyone had this problem where breakpoints in one card's resizeStack handler don't get hit, but do get hit in other cards' resizeStack handlers?
I've comfirmed that the resizeStack handler does run to completion for the card where the breakpoints don't hit. It's really puzzling.
Has anyone had this problem where breakpoints in one card's resizeStack handler don't get hit, but do get hit in other cards' resizeStack handlers?
I've comfirmed that the resizeStack handler does run to completion for the card where the breakpoints don't hit. It's really puzzling.
Re: Red dot breakpoints not hit in resizeStack handler
I don't think you can set breakpoints inside the resize handler.
Annoying isn't it
I remember coming up against this at some point - I can't remember if outsourcing the action to another handler helped (called from on resizeStack), but bit it may be worth a try...
Annoying isn't it
I remember coming up against this at some point - I can't remember if outsourcing the action to another handler helped (called from on resizeStack), but bit it may be worth a try...
Re: Red dot breakpoints not hit in resizeStack handler
@Stam
I tried that and it only works when the outsourced handler is triggered with
send "outSourcedHander pNewWidth, pNewHeight, pOldWidth, pOldHeight" to the target in 0 milliseconds
or
dispatch "outSourcedHander" to the target with "pNewWidth, pNewHeight, pOldWidth, pOldHeight"
Have you perhaps filed a bug report for it when you came up against that?
I tried that and it only works when the outsourced handler is triggered with
send "outSourcedHander pNewWidth, pNewHeight, pOldWidth, pOldHeight" to the target in 0 milliseconds
or
dispatch "outSourcedHander" to the target with "pNewWidth, pNewHeight, pOldWidth, pOldHeight"
Have you perhaps filed a bug report for it when you came up against that?
Re: Red dot breakpoints not hit in resizeStack handler
No I didn't - but now that you mention it, I think I did the same as you - I called the script from the message box to test it worked. Once I was happy it worked I just called it from resizeStack. Or some such...
Note that according to the documentation:
This means that breakpoints won't work either, it's a known issue and presumably one that will be addressed in v10...Dictionary > ResizeStack wrote:Known issue:* Currently errors in moveStack and resizeStack are ignored, as this was causing a hang in the IDE.
Re: Red dot breakpoints not hit in resizeStack handler
Speaking of errors in the resizeStack handler,
the very code I've been trying to debug now throws an unexplained error.
I send a message called "resizeStack2" from the resizeStack handler. It takes the same parameters as the resizeStack handler; i.e.
pNewWidth, pNewHeight, pOldWidth, pOldHeight
When I do the following in resizeStack2:
it throws the error
"execution error at line <whatever> (Operators /: error in left operand), char 1"
at the line "put tNewH / 682 into theRatio"
and checking the value of tNewH shows it contains an integer as one would expect, but for some reason the "/" operator has a problem with it.
the very code I've been trying to debug now throws an unexplained error.
I send a message called "resizeStack2" from the resizeStack handler. It takes the same parameters as the resizeStack handler; i.e.
pNewWidth, pNewHeight, pOldWidth, pOldHeight
When I do the following in resizeStack2:
Code: Select all
local tNewH
on resizeStack2 pNewWidth, pNewHeight, pOldWidth, pOldHeight
-- the original height of the stack is 682
if pNewHeight is empty then
put the height of this stack into tNewH
else
put pNewHeight into tNewH
end if
put tNewH / 682 into theRatio
-- use theRatio to resize other controls on the card ...
end resizeStack2
"execution error at line <whatever> (Operators /: error in left operand), char 1"
at the line "put tNewH / 682 into theRatio"
and checking the value of tNewH shows it contains an integer as one would expect, but for some reason the "/" operator has a problem with it.
Re: Red dot breakpoints not hit in resizeStack handler
Out of curiosity, if you just call resizeStack2 from a button or message box with some values (i.e. not through the resizeStack handler) does it still generate tis error?Cairoo wrote: ↑Mon Nov 14, 2022 1:18 pmSpeaking of errors in the resizeStack handler,
the very code I've been trying to debug now throws an unexplained error.
I send a message called "resizeStack2" from the resizeStack handler. It takes the same parameters as the resizeStack handler; i.e.
pNewWidth, pNewHeight, pOldWidth, pOldHeight
When I do the following in resizeStack2:it throws the errorCode: Select all
local tNewH on resizeStack2 pNewWidth, pNewHeight, pOldWidth, pOldHeight -- the original height of the stack is 682 if pNewHeight is empty then put the height of this stack into tNewH else put pNewHeight into tNewH end if put tNewH / 682 into theRatio -- use theRatio to resize other controls on the card ... end resizeStack2
"execution error at line <whatever> (Operators /: error in left operand), char 1"
at the line "put tNewH / 682 into theRatio"
and checking the value of tNewH shows it contains an integer as one would expect, but for some reason the "/" operator has a problem with it.
Re: Red dot breakpoints not hit in resizeStack handler
Silly me.
I mistyped one of the parameters sent to resizeStack2. After correcting it, no errors.
I mistyped one of the parameters sent to resizeStack2. After correcting it, no errors.
-
- VIP Livecode Opensource Backer
- Posts: 9582
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Red dot breakpoints not hit in resizeStack handler
Stam.
Craig
What is so special about the resizeStack message, or rather a handler that might trap it, to disable the functionality of a red dot?I don't think you can set breakpoints inside the resize handler.
Annoying isn't it
Craig
Last edited by dunbarx on Mon Nov 14, 2022 3:42 pm, edited 1 time in total.
-
- VIP Livecode Opensource Backer
- Posts: 9582
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Red dot breakpoints not hit in resizeStack handler
And I assume this topic is unrelated to the fact that I am, once again, in v. 9.6.1, seeing red dots failing to "stick". I have to dismiss them and re-insert.
This was an ongoing problem for years, that was fixed many months ago. Well, was once fixed...
Craig
This was an ongoing problem for years, that was fixed many months ago. Well, was once fixed...
Craig
Re: Red dot breakpoints not hit in resizeStack handler
As mentioned above, LC ignores errors in resizeStack because it caused the IDE to hang. I think for the same reason, breakpoints are ignored as well:
stam wrote: ↑Mon Nov 14, 2022 12:02 pmNote that according to the documentation:This means that breakpoints won't work either, it's a known issue and presumably one that will be addressed in v10...Dictionary > ResizeStack wrote:Known issue:* Currently errors in moveStack and resizeStack are ignored, as this was causing a hang in the IDE.
-
- VIP Livecode Opensource Backer
- Posts: 9582
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Red dot breakpoints not hit in resizeStack handler
Stam.
AHA. OK, then.
Who knew?
Craig
AHA. OK, then.
Who knew?
Craig