Jacque, I noticed almost immediately that I didn't know what I was looking at in the errorDialog report

but I was determined to get to understand its workings !
My first playing around with it, I actually couldn't get one pre-determined error to come to mind (probably a first for me, usually I can think of TONS!).
As I sat there thinking, I finally remembered that dividing by 0 is usually a good one, so I wrote the following:
Code: Select all
// for later use in the demo...
local tmpVarOne, tmpVarTwo
on errorDialog pExecutionError, pParseError
// put the complete error in the field for study...
put cr & "An error occurred on line: " & pExecutionError & cr before field "txtErrorReport"
/* in the dictionary, it says parseError is deprecated, adding it in the put statement produced no difference in the output, so not sure if it is already part of it or not...*/
end errorDialog
on openCard
// will later be setting up multiple error situations that will run for each button click...
set the label of button "cmdInitiate" to "Error 1"
end openCard
on mouseup
// yes, I know the following can be shortened immensely...
if word 1 of the target is "button" then
if the label of the target is "Error 1" then
put 12/0 into tmpVarOne
put tmpVarOne into field "txtErrorParsed"
end if
end if
end mouseup
/* initially tried 'put 12/0 into field "txtErrorParsed" but for some reason this was just skipped in the debugger.
In the script debugger it automatically catches the error, giving this result -
card id 1002: execution error at line 15 (Operators /: divide by zero), char 1 */
In the dictionary entry on it, it also says -
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.
I take this to mean this would really be ideally used in a standalone, but does it catch things the script debugger would not?
If someone else new to Lc uses the routine, which really is a nice simple short way to find an error, the full output of errorDialog looks like this -
An error occurred on line: 379,15,17
465,15,1
253,14,1
253,13,1
241,13,1,mouseup
353,0,0,card id 1002 of stack "~/Lc_Projects/Lc601Projects/errorDialogDemo/errorDialogDemo.livecode"
I would certainly suggest using the answer dialog to get the parts of the result you want, or put the field on a card that only gets called if an error happens, or even log it to a file if you want it returned by your testing team
Needless to say, I certainly will be looking up the sample stack you and Richard wrote
I also found the following entries in the dictionary to be of interest to me on this topic and will be exploring them further -
errorMode, errorObject. scriptExecutionError, and sysError. I really can't thank you enough for setting me on the path
Edit -
Oh that Lookup plugin is a TREAT!

- LiveCode Error Lookup_001.png (11.2 KiB) Viewed 8963 times