When is a Word not a Word?

Peter Haworth pete at mollysrevenge.com
Sun Jan 9 16:48:13 CST 2011


Got weird things going on with the wordoffset function.  The code is:

put wordoffset(field "Selection",myLine) into mywordoffset

if field Selection contains xyz and myline contains abc def xyz, then wordoffset returns 3.

if field Selection contains xyz and myline contains abc def "xyz" (xyz in double quotes this time), wordoffset returns zero.

I've tried this with all combinations of casesensitive and wholematches true and false.

According to the dictionary, "A word is delimited by one or more spaces, tabs, or returns, or enclosed by double quotes" so why isn;t "xyz" recognised as a word? 

Pete Haworth











More information about the use-livecode mailing list