Mark Boyd corrected some errors in my code (thanks, Mark) and I've fixed
them but I still have problems. I am intending to fill out one list with
the randomized properties of another list. I want to use an index value to
get at the properties and values of the old list and place them in the new
one but my code doesn't work. (I don't have the hang of the syntax yet).
the program gets hung up at this line of code:
RandomDistanceList.addProp(getAt(oldDistanceList, aDistance))
Here's the code:
set oldDistanceList = [#veryNear:point(20,20), #near:point(70,70),
#middle:point(120,120),#far:point(170,170),#veryFar:point(220,220)]
--
-- -- This loop creates the randomized list, newDistanceList
set RandomDistanceList = [:]
repeat with i= 1 to 6
set aDistance = random(count(oldDistanceList))
-- -- "random(count(oldDistanceList))" counts the number of
-- ---- Distances in
-- -- the list and randomly selects one Distance--until it has done
-- -- it 6 times.
-- -- "aDistance" is the variable where the random
-- -- Distance in the list is stored
--
RandomDistanceList.addProp(getAt(oldDistanceList, aDistance))
-- -- -- this finds the value stored at that random Distance and
fills up
-- -- -- the new list with those values
-- --
-- deleteAt(oldDistanceList, aDistance)
-- -- -- Since we are still selecting from the oldDistanceLIst,
this
-- -- -- deletes the value from the oldDistanceList, so we won't
repeat values
-- -- -- from the list
-- --
end repeat
--
Thanks for your help
Paul Schulman [EMAIL PROTECTED]
[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!]