Caution with this solution.
The definition of a 'word' for LiveCode is not what you would normally think.

Spaces are not the only white space, and punctuation that is attached to the word is included as part of a word.

On Oct 13, 2010, at 4:30 PM, Jim Lambert wrote:

Razvan wrote:

How can I list every word from a textarea?

First, welcome Razvan!

In addition to Pierre"s and Richmond's suggestions, here's a few:

function getWordList someText
        replace space with cr in someText
        return someText
end getWordList

function getUniqueWordList someText
        repeat for each word w in someText
if w is not among the lines of uniqueWord then put w & cr after uniqueWords
        end repeat
        -- AND JUST FOR THE HECK OF IT
        sort uniqueWords
        return uniqueWords
end getWordList

Jim Lambert

Jim Ault
Las Vegas



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

Reply via email to