Thanks, Hugh.

Unfortunately there are a couple of problems. It won't work for this line:

   Now is the time.

because of the period.

Nor for the line

   "Now is the time for all"

because of the quotes.

Stripping the lead and trailing characters is cumbersome, but fairly 
reliable--except for quotes, where I just replace the quote with a carrot or 
whatever.



> An alternative approach:
> 
> Assuming that the phrase "now is the time, for all good men" is in fld 1,
> then this button script....
> 
> on mouseUp
>   put findWord(fld 1,"time")
> end mouseUp
> 
> function findWord pContent,pStr
>   if pStr is among the tokens of pContent then
>     return num of words of char 1 to offset(pStr,pContent) of pContent
>   else return 0
> end findWord
> 
> reurns 4 as expected. Similarly for 'time-bomb' and other variants.
> 
> Hugh Senior
> FLCo



_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to