Comment Lines interfere with continuation lines

Peter Haworth pete at lcsql.com
Thu Jun 28 13:25:00 EDT 2012


Maybe it's an LC version issue. I'm using 5.5 and there was no compile
error flagged on the original code I published, nor on my test that simply
had the line "with p1,p2" in the script.

It seems you can use some reserved words as command/function names. I tried
code in the format "put xxx(p1,p2) into t"  with various reserved words as
"xxx" and many of them compiled with no errors, including "with", "if",
"card", "stack", "filename","put" but using "ID" or "into", or
"itemdelimiter" caused a compile error.

I was able to create a function named "filename" with no compile errors but
a function named "put" wouldn't compile.

I would never use a reserved word as a command or function name in real
life but maybe those wiser than me can explain the differentiation between
types of reserved words.

Pete
lcSQL Software <http://www.lcsql.com>



On Thu, Jun 28, 2012 at 8:43 AM, Bob Sneidar <bobs at twft.com> wrote:

> That is odd because it wouldn't compile for me. Not sure why we are seeing
> different things. There cannot be a command or function that uses a
> reserved word so "with" cannot be a command or function.
>
> Bob
>
>
> On Jun 27, 2012, at 8:46 PM, Peter Haworth wrote:
>
> > Hi Peter, and Bob,
> > I see what you're saying but if that's the case I would have expected to
> > get a compile error. "with p1, p2" is certainly not a valid instruction.
> >
> > Although I just checked that out by inserting exactly that line in a the
> > middle of a script - no compile error.  I think it is interpreting it as
> a
> > call to a handler named "with". However, when the script ran, it failed
> > with a runtime error on that line.  Even tried it with a comment line
> > immediately before it and same runtime error.
> >
> > I suppose there's only so much you can expect the compile phase to do
> but I
> > still think that should have resulted in a runtime error rather than just
> > ignoring that line
> >
> > My least favorite LC compile problem is that it seems to be incapable of
> > distinguishing:
> >
> > repeat for each line tLine in ...
> >
> > from
> >
> > repeat with x=1 to …..
> >
> > If I mix the two:
> >
> > repeat for x=1 to …..
> >
> > … the compile doesn't catch it but I get a runtime error.
> >
> > Pete
> > lcSQL Software <http://www.lcsql.com>
> >
> >
> >
> > On Wed, Jun 27, 2012 at 8:17 PM, Peter M. Brigham <pmbrig at gmail.com>
> wrote:
> >
> >> I think that's because according to Bob's analysis, the parser sees
> "with
> >> p1, p2" as a misconstructed line of script, not as a comment.
> >>
> > _______________________________________________
> > 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
>
>
> _______________________________________________
> 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