longest word in a text

Peter T. Evensen pevensen at siboneylg.com
Fri Jul 14 14:43:37 EDT 2006


How about:

replace " " with return in myText
sort lines of myText descending numeric by the number of chars of each
put  line 1 of myText

I think this might be faster and is definitely shorter, and stays more 
binary (ask Chipp).

At 01:46 PM 7/14/2006, you wrote:
>Hi list,
>
>Does anyone have some very fast code to find the longest word
>(number of chars) in a text ?
>
>Here's what I have :
>
>     replace " " with cr in myText
>     put "" into temp
>     set itemdelimiter to tab
>     repeat for each line j in myText
>         put j & tab & number of chars of j & cr after temp
>     end repeat
>     sort temp descending numeric by item 2 of each
>     put item 1 of temp into longest_word
>
>Is there anything faster ?
>
>
>Best,
>JB
>
>
>
>
>
>_______________________________________________
>use-revolution mailing list
>use-revolution at lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your 
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-revolution

Peter T. Evensen
http://www.PetersRoadToHealth.com
314-629-5248 or 888-682-4588 


More information about the use-livecode mailing list