Well, there are a couple of ways you can go about it.
First, you can just use Lingo calls to get the xth word out of a
line. This may or may not help, depending on what you want to use it for.
What you might want to do is put each word in a list. Using commands like:
mySentence ="This is a joke"
numWords =the number of words in mySentence
wordList =[]
repeat with x =1 to numWords
thisWord =word x of mySentence
add(wordList, thisWord)
end repeat
Now you have built a list with 0..n variables in it, so in this case it
looks like
put wordList
-- ["This", "is", "a", "joke"]
and you can reference them individually:
put wordList[4]
-- "Joke"
At 11:31 AM 6/7/01 -0500, Tyler F Gamsby wrote:
>I am pulling one random line out of a text file, and each line has a
>different number of words. I want to break the line into words by
>assigning each word to a different variable. I have that part working
>fine, except, if I have 2 lines, one with 2 words and one with 5, I have
>had to create 5 variables and then 3-5 would be null. I wondered if there
>was a dynamic way to create variables.
>
>If anybody can help, I appreciate it.
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]