parsing comments in scripts

Alex Tweedly alex at
Mon Dec 13 15:25:52 EST 2004

At 13:43 13/12/2004 -0600, Ken Ray wrote:
> > The technique of commenting out the first line to disable the handler
> > does not work in Transcript.
>You've said this a couple of times, but I have handlers where the first line
>is commented and the handler *is* disabled. Can you give an example of where
>this is not true?

There's an example (rather trivial one) in the Bugzilla entry (2468)

A more serious one is

>on A
>   local tLine
>end A
>on mouseUp
>   B
>end mouseUp
>on B
>   put "original B string" into tLine
>   C
>   put tLine & cr after msg
>end B
>on C
>   put "the C version" into tLine
>end C

This prints out "original B string" to the message box.
Comment out the first line of A, and it will now output "the C version".

The comment has disabled handler A, except for the local tLine statement, 
which has become script-local, and therefore changed the effect of the 
(implicit) declarations of tLine within B and C. So now the two handlers 
interfere with each other, when normally they wouldn't.

-- Alex.

More information about the use-livecode mailing list