Re: Setting conditional breakpoints

2019-06-24 Thread J. Landman Gay via use-livecode
I doubt you're thick, Lagi. :) As I mentioned before, I'm having a lot 
of trouble with breakpoints lately. Also, there's a difference between a 
breakpoint and a watch, and I rarely use watches because they aren't 
universally applicable. I do use conditional breakpoints though.


A watch is supposed to catch any instance where a specified variable 
changes its value. My experiments were several years ago, but back then 
I found that only global variables honored watches. I guess that makes 
sense, since you can't trap a variable that isn't in memory already. I 
don't use watch variables any more because I don't use globals much. And 
even back then, watches weren't always reliable.


For normal breakpoints, I don't use the breakpoints pane in the editor, 
I usually set them directly in the script. Set a red dot at the place 
where you want to break, right-click the dot, and choose Edit. In the 
dialog that appears, type the condition that needs to be met. The 
condition needs to include a variable that occurs in the handler you're 
debugging.


An example:

on foo pVar
  put the number of items in pVar into tNum
  switch tNum
case 1
  doThing 1
  break
case 2
  doThing 2
  break
case 3
  doThing 3
  break
  end switch
end foo

I can now set a breakpoint at the "switch tNum" line with a condition:
  tNum = 2
and the breakpoint will only fire if that condition is met.

There used to be a problem deleting breakpoints from the pane in the 
editor window, but that was fixed a while ago. Maybe it has recurred. I 
don't use that, I just click on the dot in the script to remove it and 
that has always worked. If you're using an older version of LC, you may 
have hit that bug though.


On 6/24/19 5:49 AM, Lagi Pittas via use-livecode wrote:

Hi Jacque,

It never worked before and I couldn't get it to work today. I can't be that
thick  can I?
If the "incantation" means I can't get it work (especially the delete - the
breakpoints i set would not remove however I clicked) easily
then I would presume there are some people as dumb as me who won't be able
to do it.

I spent over half an hour trying to get a watch/breakpoint working - do you
tie the watch to the breakpoint if so how - Tried

Can you give me a recipe "for dummies"

"Don't make me think" -  Steve Krug

"Show me the Banana" - "The BIg Red Fez" - Seth Godin

"The best way to motivate the monkey, of course, is to use a banana.
  Whenever the monkey walks into a new situation, all it wants to know is,
“Where’s the banana?”
  If the banana isn’t easy to see, easy to get and obvious, the monkey is
going to lose interest.
  But, if you can make it clear to the monkey what’s in it for him, odds are
he’ll do what you want. "

Thanks

Lagi

On Sat, 22 Jun 2019 at 00:48, J. Landman Gay via use-livecode <
use-livecode@lists.runrev.com> wrote:


Set a breakpoint, right click it, choose condition, and fill out the
dialog. That's how I usually do it.
--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On June 21, 2019 5:34:30 PM Bob Sneidar via use-livecode
 wrote:


In the breakpoints tab of the script editor, if you right click the

lower

pane, you can create conditional breakpoints. For instance if the value

of

a variable is something. I have never gotten them to work, and I find I

am

needing this more and more.

Bob S



On Jun 21, 2019, at 15:26 , dunbarx--- via use-livecode
 wrote:

Not sure what you could mean.
on mouseUp  if the mouseLoc is within the rect of btn 3 then

breakPoint

if the visible  of btn 3 then breakPoint   if the...


Surely I am missing this.
Craig



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Setting conditional breakpoints

2019-06-24 Thread Mark Wieder via use-livecode

On 6/24/19 10:38 AM, Dr. Hawkins via use-livecode wrote:


But how about defining ”zetProp” as a stack (or whatever) property, and making 
the code changes I mentioned?


Yep - that's the way I work around it as well:

setprop _visible pValue
   set the visible of me to pValue
end _visible

on mouseUp pMouseButton
   set the _visible of field 1 to not the visible of field 1
end mouseUp

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Setting conditional breakpoints

2019-06-24 Thread Dr. Hawkins via use-livecode
On Jun 24, 2019, at 10:32 AM, Mark Wieder via use-livecode 
 wrote:

> 
> Unfortunately, it's still not possible to use setProp and getProp handlers 
> with built-in properties, so catching a change to the visible of an object 
> won't work. It's been in bugzilla for 14 years now.
> 
> https://quality.livecode.com/show_bug.cgi?id=3126 
> 




wow.  And so my code changes wouldn’t even be needed . . .

But how about defining ”zetProp” as a stack (or whatever) property, and making 
the code changes I mentioned?
— 
Richard E. Hawkins, Esq.
The Hawkins Law Firm
3430 E. Flamingo Rd.
Suite 232
Las Vegas, NV  89121
(702) 508-8462

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Setting conditional breakpoints

2019-06-24 Thread Mark Wieder via use-livecode

On 6/24/19 9:00 AM, doc hawk via use-livecode wrote:

> Anyway, if you use setProp handlers instead of directly setting 
properties, you could stick a little red PCD in *that*  handler.


Unfortunately, it's still not possible to use setProp and getProp 
handlers with built-in properties, so catching a change to the visible 
of an object won't work. It's been in bugzilla for 14 years now.


https://quality.livecode.com/show_bug.cgi?id=3126

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting conditional breakpoints

2019-06-24 Thread doc hawk via use-livecode

On Jun 24, 2019, at 8:11 AM, Bob Sneidar via use-livecode 
 wrote:
> 
> True, but I need itto break AT the line of code that changes a property of a 
> stack. If there is a script running while when the send in time command is 
> due, the existing script will continue to run, THEN at the first idle, the 
> send in time will run. 

It hasn’t occurred to me to try *any* conditional breakpoints in years—they 
caused crashes at least since 5.x, and I hadn’t heard that they’d been fixed.

Anyway, if you use setProp handlers instead of directly setting properties, you 
could stick a little red PCD in *that*  handler.


Do a global search for  

set the someProperty of this stack to 

and replace with

setProp someProperty,

or something similar; check your own code.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Setting conditional breakpoints

2019-06-24 Thread Bob Sneidar via use-livecode
True, but I need itto break AT the line of code that changes a property of a 
stack. If there is a script running while when the send in time command is due, 
the existing script will continue to run, THEN at the first idle, the send in 
time will run. 

Bob S


> On Jun 21, 2019, at 16:51 , Tom Glod via use-livecode 
>  wrote:
> 
> oh you can open up the engine to do other handlers by using "in time"
> 
> I use it all the time..I have a message checking hotkeys clipboard
> changes and it works beautifully.
> 
> 
> on CheckIfVisible
> if the visible of defaultstack = true then
> send "CheckIfVisible" to defaultstack in 100 milliseconds
> else
> end if
> end CheckIfVisible


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting conditional breakpoints

2019-06-24 Thread Lagi Pittas via use-livecode
Hi Jacque,

It never worked before and I couldn't get it to work today. I can't be that
thick  can I?
If the "incantation" means I can't get it work (especially the delete - the
breakpoints i set would not remove however I clicked) easily
then I would presume there are some people as dumb as me who won't be able
to do it.

I spent over half an hour trying to get a watch/breakpoint working - do you
tie the watch to the breakpoint if so how - Tried

Can you give me a recipe "for dummies"

"Don't make me think" -  Steve Krug

"Show me the Banana" - "The BIg Red Fez" - Seth Godin

"The best way to motivate the monkey, of course, is to use a banana.
 Whenever the monkey walks into a new situation, all it wants to know is,
“Where’s the banana?”
 If the banana isn’t easy to see, easy to get and obvious, the monkey is
going to lose interest.
 But, if you can make it clear to the monkey what’s in it for him, odds are
he’ll do what you want. "

Thanks

Lagi

On Sat, 22 Jun 2019 at 00:48, J. Landman Gay via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Set a breakpoint, right click it, choose condition, and fill out the
> dialog. That's how I usually do it.
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> On June 21, 2019 5:34:30 PM Bob Sneidar via use-livecode
>  wrote:
>
> > In the breakpoints tab of the script editor, if you right click the
> lower
> > pane, you can create conditional breakpoints. For instance if the value
> of
> > a variable is something. I have never gotten them to work, and I find I
> am
> > needing this more and more.
> >
> > Bob S
> >
> >
> >> On Jun 21, 2019, at 15:26 , dunbarx--- via use-livecode
> >>  wrote:
> >>
> >> Not sure what you could mean.
> >> on mouseUp  if the mouseLoc is within the rect of btn 3 then
> breakPoint
> >> if the visible  of btn 3 then breakPoint   if the...
> >>
> >>
> >> Surely I am missing this.
> >> Craig
> >
> >
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Setting conditional breakpoints

2019-06-21 Thread Tom Glod via use-livecode
oh you can open up the engine to do other handlers by using "in time"

I use it all the time..I have a message checking hotkeys clipboard
changes and it works beautifully.


on CheckIfVisible
if the visible of defaultstack = true then
send "CheckIfVisible" to defaultstack in 100 milliseconds
else
end if
end CheckIfVisible

On Fri, Jun 21, 2019 at 7:09 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> That would be true if the engine was multithreaded. As it is, I am trying
> to find the line of script that is changing the property, and until the
> script terminates, no other script can run.
>
> Bob S
>
>
> > On Jun 21, 2019, at 15:56 , Tom Glod via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > well it can be done just have a handler that checks the condition every x
> > millisecondsif true ...breakpoint..if falseresend message.
> >
> > On Fri, Jun 21, 2019 at 6:46 PM Bob Sneidar via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting conditional breakpoints

2019-06-21 Thread J. Landman Gay via use-livecode
Set a breakpoint, right click it, choose condition, and fill out the 
dialog. That's how I usually do it.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On June 21, 2019 5:34:30 PM Bob Sneidar via use-livecode 
 wrote:


In the breakpoints tab of the script editor, if you right click the lower 
pane, you can create conditional breakpoints. For instance if the value of 
a variable is something. I have never gotten them to work, and I find I am 
needing this more and more.


Bob S


On Jun 21, 2019, at 15:26 , dunbarx--- via use-livecode 
 wrote:


Not sure what you could mean.
on mouseUp  if the mouseLoc is within the rect of btn 3 then breakPoint   
if the visible  of btn 3 then breakPoint   if the...



Surely I am missing this.
Craig



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting conditional breakpoints

2019-06-21 Thread Bob Sneidar via use-livecode
That would be true if the engine was multithreaded. As it is, I am trying to 
find the line of script that is changing the property, and until the script 
terminates, no other script can run. 

Bob S


> On Jun 21, 2019, at 15:56 , Tom Glod via use-livecode 
>  wrote:
> 
> well it can be done just have a handler that checks the condition every x
> millisecondsif true ...breakpoint..if falseresend message.
> 
> On Fri, Jun 21, 2019 at 6:46 PM Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting conditional breakpoints

2019-06-21 Thread Bob Sneidar via use-livecode
https://quality.livecode.com/show_bug.cgi?id=22203

> On Jun 21, 2019, at 15:46 , Bob Sneidar via use-livecode 
>  wrote:
> 
> OK looks like setting a breakpoint on a property change like the visible of a 
> stack can't be done. Might be a nice addition though. Let's say you have a 
> custom property that keeps getting corrupted (by which I mean it contains bad 
> data) and you want to catch it in the act. Wouldn't it be nice to be able to 
> set a breakpoint for a property like you can for a variable? 
> 
> I'll file an enhancement request. 
> 
> Bob S


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting conditional breakpoints

2019-06-21 Thread Tom Glod via use-livecode
well it can be done just have a handler that checks the condition every x
millisecondsif true ...breakpoint..if falseresend message.

On Fri, Jun 21, 2019 at 6:46 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> OK looks like setting a breakpoint on a property change like the visible
> of a stack can't be done. Might be a nice addition though. Let's say you
> have a custom property that keeps getting corrupted (by which I mean it
> contains bad data) and you want to catch it in the act. Wouldn't it be nice
> to be able to set a breakpoint for a property like you can for a variable?
>
> I'll file an enhancement request.
>
> Bob S
>
>
> > On Jun 21, 2019, at 15:32 , Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > In the breakpoints tab of the script editor, if you right click the
> lower pane, you can create conditional breakpoints. For instance if the
> value of a variable is something. I have never gotten them to work, and I
> find I am needing this more and more.
> >
> > Bob S
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting conditional breakpoints

2019-06-21 Thread Bob Sneidar via use-livecode
OK looks like setting a breakpoint on a property change like the visible of a 
stack can't be done. Might be a nice addition though. Let's say you have a 
custom property that keeps getting corrupted (by which I mean it contains bad 
data) and you want to catch it in the act. Wouldn't it be nice to be able to 
set a breakpoint for a property like you can for a variable? 

I'll file an enhancement request. 

Bob S


> On Jun 21, 2019, at 15:32 , Bob Sneidar via use-livecode 
>  wrote:
> 
> In the breakpoints tab of the script editor, if you right click the lower 
> pane, you can create conditional breakpoints. For instance if the value of a 
> variable is something. I have never gotten them to work, and I find I am 
> needing this more and more. 
> 
> Bob S


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting conditional breakpoints

2019-06-21 Thread Bob Sneidar via use-livecode
In the breakpoints tab of the script editor, if you right click the lower pane, 
you can create conditional breakpoints. For instance if the value of a variable 
is something. I have never gotten them to work, and I find I am needing this 
more and more. 

Bob S


> On Jun 21, 2019, at 15:26 , dunbarx--- via use-livecode 
>  wrote:
> 
> Not sure what you could mean.
> on mouseUp  if the mouseLoc is within the rect of btn 3 then breakPoint   if 
> the visible  of btn 3 then breakPoint   if the...
> 
> 
> Surely I am missing this.
> Craig


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting conditional breakpoints

2019-06-21 Thread dunbarx--- via use-livecode
Not sure what you could mean.
on mouseUp  if the mouseLoc is within the rect of btn 3 then breakPoint   if 
the visible  of btn 3 then breakPoint   if the...


Surely I am missing this.
Craig

-Original Message-
From: Bob Sneidar via use-livecode 
To: How to use LiveCode 
Cc: Bob Sneidar 
Sent: Fri, Jun 21, 2019 5:43 pm
Subject: Setting conditional breakpoints

Hi all. 

How do I set a conditional breakpoint based upon a property? I tried using the 
visible of stack "Forms Generator" is true, but I cannot enable the breakpoint 
and it says there is no condition, even though there it is!

Bob S


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode