When is a "word" not a "word"?

Ken Ray kray at sonsothunder.com
Sun Jun 6 00:17:16 EDT 2004


Barry,

Try this:

on mouseUp
  local tStart,tEnd
  put the number of words of fld 1 into tNum
  repeat with x = 1 to tNum
    get matchChunk(word x of fld 1,"(\w*)",tStart,tEnd)
    if it is true then
      select char tStart to tEnd of word x of fld 1
    else
      -- process match error here; shouldn't happen
    end if
    wait 500 milliseconds
  end repeat
  select empty
end mouseUp

HTH,

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/


> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com 
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of 
> Barry Levine
> Sent: Saturday, June 05, 2004 8:44 AM
> To: use-revolution at lists.runrev.com
> Subject: Re: When is a "word" not a "word"?
> 
> 
> Richard,
> 
> Thanks for the  reply. Unfortunately, the "?" isn't one of the 
> delimiters recognized by token. Perhaps it will be helpful if 
> I explain 
> further. I'm using Transcript to highlight the words in a sentence 
> sequentially but I'd like the punctuation -not- to be 
> highlighted when 
> this occurs. For example, field 1 contains:
> 
> My dog has fleas. Does yours?
> 
> How do I tell my stack to hilite the word "yours" (without the "?")?
> 
> Thanks,
> Barry
> 
> On Jun 4, 2004, at 11:31 PM, use-revolution-request at lists.runrev.com 
> wrote:
> 
> > From: Richard Gaskin <ambassador at fourthworld.com>
> > Subject: Re: When is a "word" not a "word"?
> >
> > Try token instead of word.
> > -- 
> >   Richard Gaskin
> >
> > Barry Levine wrote:
> >> I may be misinterpreting things or simply have an erroneous
> >> expectation:
> >>
> >> Let's say you have a field containing the text "Is this something?"
> >>
> >> Double-click on the last word and the nine letters that make up the
> >> word
> >> are selected. That seems to be what you would expect. Now open the
> >> message box and type "the last word of field 1". What do you get? 
> >> That's
> >> right; the "?" is also part of the last word.
> >>
> >> So I guess what I'm looking for is the Transcript equivalent of 
> >> double-clicking a word. There's the "clickChunk" but that implies 
> >> I've actually clicked on the word. This needs to be done 
> independent 
> >> of any mouseClicks.
> >>
> >> How would I describe: "the last word minus the last char 
> of field 1"
> >
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com 
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 




More information about the use-livecode mailing list