match{chunk,text} problem

Dave Cragg dcragg at lacscentre.co.uk
Sat Dec 29 18:50:01 EST 2001


At 4:08 pm -0500 29/12/01, Victor Eijkhout wrote:
>I'm going out of my mind.
>
>on mouseup
>   put "a/b/c" into fn
>   put 0 into n1
>   put 0 into n2
>   matchchunk(fn,"([^/]*)$",n1,n2)
>   put n1 && n2
>end mouseup
>
>  * There was a Script Compile Error at 4:07:01 PM
>Error description:  Expression: missing ')' before factor
>Object: field id 1239 of card id 1002 of stack "/Macintosh 
>HD/Users/victorle/Documents/Revolution programming/alarm.rev"
>--------------------
>matchchunk(fn,"([^/]*)$",n1,n2)
>--------------------
>Value:
>
>What obvious thing am I overlooking?

It's only obvious when you remember. :)

matchChunk is a function so you need to use:

get matchChunk(fn,"([^/]*)$",n1,n2)

Considering the number of times I've fallen foul of this diabolical 
trap <g>, I wonder if some more helpful error message couldn't be 
given.

Cheers
Dave Cragg




More information about the use-livecode mailing list