Comment Lines interfere with continuation lines
bobs at twft.com
Thu Jun 28 16:14:19 CDT 2012
Well that is the oddest thing. Now when I type the code in myself, I do NOT get a compile error! How odd that "WITH" can be used as a command! Livecode is indeed merciful and forgiving!
In a button script:
ON mouseUp pMouseBtnNo
put "Test " into p1
put "THIS!" into p2
dispatch "test" to this card \
in the card script:
ON WITH p1, p2
put p1 & p2
On Jun 28, 2012, at 10:25 AM, Peter Haworth wrote:
> 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.
> 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.
>> 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
>>> 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
>>> repeat for each line tLine in ...
>>> 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.
>>> lcSQL Software <http://www.lcsql.com>
>>> On Wed, Jun 27, 2012 at 8:17 PM, Peter M. Brigham <pmbrig at gmail.com>
>>>> I think that's because according to Bob's analysis, the parser sees
>>>> 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:
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode