von dp am 22.Dezember 96 um 15:50:20:
zu: Perlen aus dem Strom der Nachrichten im direct_L von Daniel am 22.Dezember 96 um 02:00:59:
Don Relyea writes on Nov 25 of a radar screen, where objects should execute
their "stepFrame" methods in order of the value of a particular common property
-- in order of distance, in this case.
If the critical property rarely changes then you might be able to do the
original insertion to the actorList based on the sort... would eliminate
continual resorting of the actorList.
If the property regularly changes, then would it be possible for the individual
stepFrame methods to add their objects' new positions to a new common property
list, and then to sort and draw this list at the end of the process? That would
eliminate querying each object in the actorList for a specific property at each
iteration, and would also allow the sorting to be done with a single Lingo
command before the draw.
(Another option, assuming these individual objects need to be in the actorList
for other reasons, would be to not include the radar-drawing in their stepFrame
methods, but to instead add a manager object which compares their distances at
each stepFrame before calling each object's "draw" method in proper order...
would probably be about the same calculational costs, but would eliminate
modifying the actorList while evaluating the actorList.)
Don't know if there's anything real in this post here, Don, but I'll be looking
forward to seeing your eventual results.... ;)
Regards,
John Dowdell
Macromedia Tech Support
Blake Freeburg writes on Dec 2 of having a list of property lists of structure The Lingo "sort" command will sort the values in a list, but your outer list is Flopping it around, might the larger question be: "How can I set up a database >> set ageList to ["Blake": 31, "Robert": 28...] You can then sort these lists. By calling up any value in any of these fields, The above's pretty concentrated, but do you see what I'm trying to get at...? Regards,
[[#name:
the value in each of the inner lists' "name" properties.
a list of lists, and not a list of values. What will happen, I believe, is that
the outer list will be sorted by the current memory addresses of the inner
lists, and would not be predictable or useful.
structure so that I can sort records on any field?" If so, then one approach is
to use multiple lists, each containing a single field across all records, with
each entry's property name a unique identifier for each record, as in:
>> set phoneList to ["Blake": 7373737, "Robert": 8282828...]
>> set pugiList to ["Blake": "Holyfield", "Robert": "Tyson"....]
you can retrieve the corresponding property name, which identifies corresponding
fields of the same record in the other lists. (The above script fragment assumes
that the first name will not be duplicated among participants, and is only an
example... for larger databases you'd need a different record ID than "Blake" or
"Robert".)
John Dowdell
Macromedia Tech Support
D. Plänitz