Re: errorDialog broken?

2016-04-14 Thread Richard Gaskin

Mark Waddingham wrote:

> The IDE engine itself doesn't have any special handling for errors
> (relative to the standalone engine) - however, the IDE must be doing
> something *somewhere* as the part of the engine which implements the
> engine-side part of the debugger is distinct from the part which
> dispatches the errorDialog message (as far as I can see anyway).

I also would have thought this was handled solely in the IDE, but if so 
how could the executionContexts not show any IDE handling until the 
errorDialog arrives at that one particular IDE script.


IIRC revbackscriptlibrary isn't ancient, probably circa v4 or so when 
the other major IDE changes came about.  It certainly wasn't in v1 or 
v2, and of course wasn't in the MetaCard IDE, which I was using until 
about LC v4.



> My general feeling is that the errorDialog message should not be
> affected by Script Debug Mode.

Agreed.

> Ideally, the debugger would kick in when an error is thrown (allowing
> you to see the context of the error) and then when you click
> 'Continue' it should then still propagate an errorDialog message.

Yes, that would seem the most useful behavior, allowing both IDE 
intervention for debugging while also triggering scripts the developer 
put into place.


Should I add your ideal option to the bug report notes?  Given how long 
this has been working as it does I don't imagine changing it will be 
essential for v8.0, but it would seem helpful to capture your good 
thinking on this for when there's time to work on it.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.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: errorDialog broken?

2016-04-14 Thread Mark Waddingham

On 2016-04-14 17:06, Richard Gaskin wrote:

It's almost like the IDE engine has had special handling added at some
point to send errorDialog messages directly to one particular IDE
script.


To be fair, it does say in the dictionary under 'errorDialog':

Note: The errorDialog message is only sent while Script Debug mode is 
turned off. To toggle Script Debug mode, click on the Development menu 
of LiveCode's menubar.


So at least the behavior you are seeing is documented (for once ;)) [ of 
course, I cannot say whether that note was added because that was the 
observed behavior, or whether it was the intended behavior ].


The IDE engine itself doesn't have any special handling for errors 
(relative to the standalone engine) - however, the IDE must be doing 
something *somewhere* as the part of the engine which implements the 
engine-side part of the debugger is distinct from the part which 
dispatches the errorDialog message (as far as I can see anyway).


The errorDialog message does interact with the 'lock error dialogs' 
command - if the latter has been called then it changes the target of 
the errorDialog message to the object which administered the lock (this 
remains until the current handler stack resolves, or 'unlock error 
dialogs' occurs).


My general feeling is that the errorDialog message should not be 
affected by Script Debug Mode. Ideally, the debugger would kick in when 
an error is thrown (allowing you to see the context of the error) and 
then when you click 'Continue' it should then still propagate an 
errorDialog message.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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: errorDialog broken?

2016-04-14 Thread Richard Gaskin

Mark Waddingham wrote:

> When the script debugger is active, errors indirect via a different
> message (traceError) - so my hypothesis was that the debugger is
> intervening and causing the target of the errorDialog message to
> change so that your button is no longer in the message path, and thus
> it falls through to the backscript handler. Of course, this is all
> purely conjecture at the moment - I haven't had a chance to check it
> directly yet today!

I could understand the errant script (the button) being omitted from the 
message path during an error condition, but what surprised me is that 
the stack's script was also omitted.


Exploring further, I created a stack which I put into the message path 
with "start using", which has:


on errorDialog
  put the name of me && the params
end errorDialog

It was ignored too. :\

It's almost like the IDE engine has had special handling added at some 
point to send errorDialog messages directly to one particular IDE script.



> To be fair, there definitely sounds like something fishy is going on
> here so could you file a bug report with your findings and we can
> look into it more deeply.

Thanks - done:


FWIW, this behavior is the same when I test with the oldest version I 
have installed, 6.7rc2.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.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: errorDialog broken?

2016-04-14 Thread Mark Waddingham

On 2016-04-14 16:22, Richard Gaskin wrote:

What I get in the message box is just two lines:

- the errorDialog handler in revbackscriptlibrary
- mouseup from the button that starts the execution path.

What could cause all other scripts to be bypassed to favor one
particular backscript?


My thinking was that the debugger was doing 'something' which causes the 
errorDialog message to no longer be targetted at the object which 
generated it and thus it would fall through to the backscript.




This was interesting:


That being said, there is a bughancement (I can't quite decide
whether it should be considered a bug or not - it is how the
engine's debugger has always worked after all) here to have
throwing of errors work the same way in the debugger as other
dev tools. i.e. The debugger should break when a throw occurs,
but then not actually interrupt normal processing when you
continue to execute.


Doesn't sound related to what I'm seeing with the odd message path for
errorDialog - could it be?


When the script debugger is active, errors indirect via a different 
message (traceError) - so my hypothesis was that the debugger is 
intervening and causing the target of the errorDialog message to change 
so that your button is no longer in the message path, and thus it falls 
through to the backscript handler. Of course, this is all purely 
conjecture at the moment - I haven't had a chance to check it directly 
yet today!


To be fair, there definitely sounds like something fishy is going on 
here so could you file a bug report with your findings and we can look 
into it more deeply.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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: errorDialog broken?

2016-04-14 Thread Richard Gaskin

Mark Waddingham wrote:

> On 2016-04-13 22:46, Richard Gaskin wrote:
>> Ralph DiMola wrote:
>>
>>> It works in a library stack. In fact it also catches IDE errors.
>>
>> Thanks.  I found the culprit:  I hadn't yet turned off "Debug Mode"
>> (still don't know why the default is to create yet one more
>> difference between IDE and runtime, but oh well...)
>
> Perhaps because the assumption is that most people when using a dev
> tool will actually want interactive debugging by default ;)

You might think so, until the user explicitly expresses a desire to 
handle the errorDialog message themselves by writing an errorDialog handler.


But that's just a design decision.  What seems obvious to you or to me 
or anyone else may differ from time to time.  That's ok.


The weird part is how it works - or perhaps doesn't work:

I have this in a button:

on mouseUp
   throw "Some random message"
end mouseUp

...and this in the stack script:

on errorDialog
  put the params
end errorDialog

My stack's errorDialog message never triggers, but the one in 
revbackscriptlibrary does.


That seemed weird to me, so I thought perhaps one of the debug messages 
is trapping something else and explicitly sending "errorDialog", so I 
added this to the errorDialog handler in revbackscriptlibrary just below 
the handler declaration (which was in itself an odd exercise - 
 ):


   put the executionContexts

What I get in the message box is just two lines:

- the errorDialog handler in revbackscriptlibrary
- mouseup from the button that starts the execution path.

What could cause all other scripts to be bypassed to favor one 
particular backscript?



This was interesting:

> That being said, there is a bughancement (I can't quite decide
> whether it should be considered a bug or not - it is how the
> engine's debugger has always worked after all) here to have
> throwing of errors work the same way in the debugger as other
> dev tools. i.e. The debugger should break when a throw occurs,
> but then not actually interrupt normal processing when you
> continue to execute.

Doesn't sound related to what I'm seeing with the odd message path for 
errorDialog - could it be?


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.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: errorDialog broken?

2016-04-14 Thread Mark Waddingham

On 2016-04-13 22:46, Richard Gaskin wrote:

Ralph DiMola wrote:


It works in a library stack. In fact it also catches IDE errors.


Thanks.  I found the culprit:  I hadn't yet turned off "Debug Mode"
(still don't know why the default is to create yet one more difference
between IDE and runtime, but oh well...)


Perhaps because the assumption is that most people when using a dev tool 
will actually want interactive debugging by default ;)


That being said, there is a bughancement (I can't quite decide whether 
it should be considered a bug or not - it is how the engine's debugger 
has always worked after all) here to have throwing of errors work the 
same way in the debugger as other dev tools. i.e. The debugger should 
break when a throw occurs, but then not actually interrupt normal 
processing when you continue to execute.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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: errorDialog broken?

2016-04-13 Thread Richard Gaskin

Ralph DiMola wrote:

> It works in a library stack. In fact it also catches IDE errors.

Thanks.  I found the culprit:  I hadn't yet turned off "Debug Mode" 
(still don't know why the default is to create yet one more difference 
between IDE and runtime, but oh well...)


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.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: errorDialog broken?

2016-04-13 Thread Ralph DiMola
It works in a library stack. In fact it also catches IDE errors.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net

-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of Richard Gaskin
Sent: Wednesday, April 13, 2016 4:22 PM
To: How to use LiveCode
Subject: errorDialog broken?

Many years ago I thought I could use the errorDialog message to catch throw
statements, but when I try that here in both v6 and v8 I find all
errorDialog handlers are ignored

- EXCEPT -

...for the one in LC's revbackscriptlibrary

1. Why?

2. How?

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  
  ambassa...@fourthworld.comhttp://www.FourthWorld.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


___
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


errorDialog broken?

2016-04-13 Thread Richard Gaskin
Many years ago I thought I could use the errorDialog message to catch 
throw statements, but when I try that here in both v6 and v8 I find all 
errorDialog handlers are ignored


- EXCEPT -

...for the one in LC's revbackscriptlibrary

1. Why?

2. How?

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.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