Heads & Tails

Mark Greenberg markgreenberg at cox.net
Sun Dec 11 07:54:53 EST 2005


Beautiful solution!  The arrays are probably much faster than the  
regular expressions too.  And I learned a new command: Combine.   
Thanks for teaching me.  : )

On Dec 10, 2005, at 6:52 AM, Jim Hurley wrote:

> on mouseUP
>    put field 1 into tText
>    put char 1 of tText into tLastChar
>   --Separate the string of h's and t's into words
>    repeat for each char c in tText
>      if c = tLastChar then
>        put c after results
>      else put  space & c after results
>        put c into tLastChar
>    end repeat
>
>    --Do a word count
>    repeat for each word tWord in results
>      add 1 to tWordCount[tWord]
>    end repeat
>
>    --Display
>    combine tWordCount with return and comma
>    put tWordCount into field 2
> end mouseUP




More information about the use-livecode mailing list