parsing comments in scripts

Ken Ray kray at sonsothunder.com
Sat Dec 11 14:14:18 EST 2004


On 12/11/04 12:18 PM, "Mark Wieder" <mwieder at ahsoftware.net> wrote:

> Alex-
> 
> Saturday, December 11, 2004, 4:38:59 AM, you wrote:
> 
> AT> that says
>>>  Tip:  You can comment out an entire handler by commenting out its first
>>> line.
> 
> Yikes! I really hope this isn't supposed to be true. I regularly put
> comments in the first line of my handlers as documentation.

Don't worry, Mark... what it means is that this:

--on mouseUp
beep
end mouseUp

won't trigger, but either of these:

on mouseUp
  -- beep now
  beep
end mouseUp

on mouseUp  -- beep now
  beep
end mouseUp

will trigger just fine.

Personally, I find just commenting the first line of a handler (like "--on
mouseUp") to be a bit sloppy IMHO and makes the script harder to read for me
(I keep thinking there's some kind of mistake in the code which is why it
isn't formatted properly; until I scroll up an see the commented "on" and
then realize my mistake).

But that's just my opinion...

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list