i suspect, however, that you don't need to do what you think you need to
do to acheive what you want to acheive.
and i don't know what that is, but you have access to both the number of
words in each line, and what each word is, using text lingo.
you can loop through them in order, extract particular words you need,
anything you want. no need to take that intermediate step by putting
them into individual variables

the whole line is already in a variable, so access each word using theline.word[x]

--bhakti

Tab Julius wrote:
> 
> 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!]

-- 
R. Bhakti Klein
Educational Software R & D
http://www.DLWorkshop.net
��
Baritone
���
"On Earth, you can only do little things;
but you can do them with a lot of Love."
                              -- Mother Theresa

[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!]

Reply via email to