Comment Lines interfere with continuation lines

Bob Sneidar bobs at twft.com
Wed Jun 27 18:13:25 CDT 2012


I think the way to look at this is to replace the backslash and cr with empty (which is how the compiler sees it) and then see if it makes sense. What you get is: 

dispatch function "xyz" to button "123" --Bug# 567
with p1,p3

Well, as you can see, it won't choke on the first line because putting a comment at the end of a line is perfectly legal, but it certainly will on the second! 

Bob


On Jun 27, 2012, at 3:44 PM, Peter Haworth wrote:

> I've got into the habit of surrounding changes to my scripts with a couple
> of comment lines that include a reference to the bug/enhancement request
> that cuased them to be changed.
> 
> I recently ran into this interesting situation.
> 
> My original code looked like:
> 
> dispatch function "xyz" to button "123" \
>    with p1,p2
> 
> After commenting, the code looked like this:
> 
> dispatch function "xyz" to button "123" \
>  --Bug# 567
>    with p1,p3
>  --/Bug# 567
> 
> The "with p1,p3" line was colored correctly, not as a green comment line
> 
> When testing the bug fix, I put a breakpoint at the start of funtion "xyz"
> and found that the paramaters to it were all empty, depstite the fact that
> when checked right at the dispatch command they had non-empty values in
> them.
> 
> After spending some time trying to figure this out and totally exhausting
> my arsenal of swear words that usually fix this type of problem, I
> desparately moved the comment lines to before the dispatch command and
> after the "with p1,p3" line and all resumed working as expected.
> 
> It seems that inserting a comment line after a continued line causes the
> remainder of the continued line to be ignored.
> 
> Not really very interesting but I thought reporting this may avoid some
> unnecessary frustrations.
> 
> Pete
> lcSQL Software <http://www.lcsql.com>
> _______________________________________________
> 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