Hi. I have an application in which I am trying to
randomize tthe location (as one of 5) of the
presentation of a spot. I havecreated a property
list, then, using the count command, I have randomly
selected a position from the list. I plan to use that
to fill out a null list ( newDistanceList [:]) and
delete the items in the old list. I've successfully
done this using a linear list but not using a property
list. Here is my code. I am getting error messages
at the point where I add to the new list
(newDistanceList).
center = point(240,240)
veryNear = point(20,20)
near = point(70,70)
middle = point(120,120)
far = point(170,170)
veryFar = point(220,220)
set oldDistanceList = ["veryNear", "near",
"middle","far","veryFar"]
--
-- -- This loop creates the randomized list,
newDistanceList
set newDistanceList = []
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
--
addProp(newDistanceList, getAt(oldDistanceList,
aDistance))
-- -- this finds the value stored at that
random Distance and fills up
-- -- the new list with those valuesBUT IT
DOESN'T DO THIS AT ALL.The -- -- --------------syntax
is all wrong and I don't know how or where
--
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
Paul Schulman
__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/
[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!]