Get a handler from a script

Wouter wouter.abraham at scarlet.be
Mon Mar 20 08:19:35 EST 2006


A little update.
And beware of the mail wraps

On 20 Mar 2006, at 10:50, Wouter wrote:

-snip-

> /* this is a comment
> #as is this */function removeBlockComments pText   --toggle the #
> put true into tFlag
> repeat for each line i in pText
>   if char 1 to 2 of word 1 of i = "/*"  then
>     put false into tFlag
>   end if
if tFlag and token 1 of i is among the items of  
"on,function,setprop,getprop" then put token 1 to -1 of  i & cr after  
tList
>
>   else if tFlag = false then
>     if char 1 of word 1 of i is "#" and "*/" is in i then
>       put true into tFlag
>       get  "/*" &i
>       if tFlag and token 1 of it is among the items of  
> "on,function,setprop,getprop" then
>         put token 1 to -1 of  it & cr after tList
>         next repeat
>       end if
>     end if
>     repeat for each token j in i
>       if j is "*/"  then
>         put true into tFlag
>         get  "/*" &i
>         if tFlag and token 1 of it is among the items of  
> "on,function,setprop,getprop" then
>           put token 1 to -1 of  it & cr after tList
>           exit repeat
>         end if
>       end if
>     end repeat
>   end if
> end repeat
> return tList
> end removeBlockComments


Greetings,
Wouter





More information about the use-livecode mailing list