Goodbye stsMLXEditor

Peter Haworth pete at lcsql.com
Sun Aug 30 22:01:09 EDT 2015


Thanks for checking that out Kay.  I am using LC 7.0.6 but I'm sure the
same condition applies.

If I get a chance, I will check out the sts plugin code and see if changing
it to check the result after setting the script fixes it.  Sounds like it
will.

Mark's right about interpreting the numbers.  In fact the plugin displays
not only the numbers but the errors associated with them.

While we're talking about script errors, another pet peeve of mine is:
compilation stops after finding the first error.  Would really like to see
all errors flagged in whatever new Script Editor is coming down the pike.

Pete


On Sun, Aug 30, 2015 at 5:46 PM Kay C Lan <lan.kc.macmail at gmail.com> wrote:

> On Mon, Aug 31, 2015 at 6:31 AM, Peter Haworth <pete at lcsql.com> wrote:
>
> > I decided to give this another try since I really like using Textmate.
> >
> > Thank you.
>
> >
> > However it seems that not all errors are detected.  So far the missing
> > errors are those associated with Strict Compile mode, e.g. missing local
> > variable definitions, missing quotes around certain language elements.
> >
>
> In the 7.1 rc 1 Dictionary it says this under the 'script' property entry:
>
> LiveCode compiles the script immediately after it is set.
>
> For the 'scriptParsingError' message entry:
>
> Sent to an object when its script cannot be compiled.
>
> Followed by this VERY important Note:
>
> The scriptParsingError message is no longer sent. Instead, any parse error
> is now put into the result immediately after setting the script of an
> object.
>
> So I:
>
> New Main Stack
> Added a button and named it 'one'
> Added a button and named it 'two'
>
> In btn one added a script:
>
> on mouseUp
>    if (the script of btn "two" = empty) then
>       set the script of btn "two" to "on mouseUp" & cr & \
>             "repeat with x = 1 to 10" & cr & \
>             "put " & quote & "A" & quote & "x into y" & cr & \
>             "end repeat" & cr & \
>             "put y into msg" & cr & \
>             "end mouseUp"
>    else
>       set the script of btn "two" to empty
>    end if
>    put the result into msg
> end mouseUp
>
> Apply
>
> Clicked on btn 'one' and I get this:
>
> 117,3,8
> 265,3,8
> 394,3,8
> 395,3,8
> 319,3,8
> 166,3,8
> 165,3,8
>
> I was expecting an error, because the line:
>
> put "A"x into y
>
> is wrong, but the msg if I were to Apply that script in the Script Editor
> is:
>
> button "two": compilation error at line 3 (Expression: bad factor), char 8
>
> So I can figure out the relationship between the 3 and the 8, but the fist
> number on each line is pretty cryptic.
>
> With Strict Compilation turned On, if I amend the offending line to:
>
>  "put " & quote & "A" & quote & " & x into y" & cr & \
>
> And click btn 'one' I get no errors. But if I open the script to btn 'two'
> when it contains the script:
>
> on mouseUp
> repeat with x = 1 to 10
> put "A" & x into y
> end repeat
> put y into msg
> end mouseUp
>
> and Apply it I get the Error msg:
>
> button "two": compilation error at line 3 (Chunk: can't create a variable
> with that name (explicitVariables?)) near "y", char 13
>
> So this wouldn't appear to be anything to do with sts but how LC handles
> 'set the script of' and apparently a different level of syntax checking
> when compared to using the SE's Apply btn.
>
> Nice find Peter!
>
> 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.
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list