Goodbye stsMLXEditor
Mark Wieder
mwieder at ahsoftware.net
Sun Aug 30 21:33:49 EDT 2015
On 08/30/2015 05:46 PM, Kay C Lan wrote:
> There would seem to be two issues, firstly the different level of
> Compilation checking, and secondly, the Dictionary entry for
> 'scriptParseError' implies that the error message we are going to get is
> human readable. What currently is presented in the result is of little use
> unless there is documentation to decipher the numbers; although the SE
> style error message is really what we want.
Well, yes and no. Unfortunately that message is no longer being sent.
There's a bug report in the system to try to get it back, but it's been
languishing from lack of attention for quite some time.
The difference in the error texts you're seeing is just the IDE's script
editor interpreting the rather cryptic numeric messages you're seeing
when you look at the raw data. The lines are of the form
errorNumber, lineNumber, charNumber
and the errorNumber is an index into a list of strings stored in a
couple of global properties. There's one list for compilation errors and
one list for runtime errors. I wrote a handy function for PowerDebug to
show these things because it's awkward trying to remember what the
various error numbers mean.
function ExplainError pErrorNum, pErrorType
local tFunc
local tResult
if pErrorType is empty then
put "runtime" into pErrorType
end if
switch pErrorType
case "compilation"
put line pErrorNum of the scriptparsingerrors into tResult
break
case "runtime"
default
put line pErrorNum of the scriptexecutionerrors into tResult
end switch
return tResult
end ExplainError
...So the error list you see represents
Expression: bad factor
param: bad expression
Commands: bad parameter
Commands: bad parameters
repeat: error in command
Handler: error in command
Handler: error in handler
and normally it's safe to ignore everything except the first line you
receive.
--
Mark Wieder
ahsoftware at gmail.com
More information about the use-livecode
mailing list