Ask a Question related to Macromedia Director Lingo, Design and Development.
-
minerale webforumsuser@macromedia.com #1
Sorting the contents of a list backwards
Is it possible to sort the contents of a list backwards?
Put the values into an array the opposite way round?
thanks
m
minerale webforumsuser@macromedia.com Guest
-
Write contents of Dropdown list to a database
i am dynmically creating a dropdown list and i am wondering how to write the contents of the dropdown list to a database. Purpose: i am creating... -
positioning of drop down list contents
I have created a simple drop down list using the drop down list library behavior which works perfectly -- EXCEPT the list items, instead of... -
Another mega list of inspiring Shockwave 3D contents
I have just been sent this link to a mega list of Shockwave 3D contents. Have a look. It's worth it !... -
sorting on hash contents
Hi, all. Say I have a hash of 4 elements, val and name h = "1,2,3,fred" h = "4,1,2,jack" h = "3,3,4,jill" How do I define: -
List all and field names database contents
I have been provided with a DSN, user name and password for one of my clients sites. I'm not an ASP developer and need to view all the contents... -
Andrew Morton #2
Re: Sorting the contents of a list backwards
No, but you could access it the other way round.
n=count(myList)
repeat with i=n down to 1
something(myList[i])
end repeat
Andrew
Andrew Morton Guest
-
Richie Bisset #3
Re: Sorting the contents of a list backwards
set n = myList.count
repeat while n > 0
add myList2, myList[n]
set n = n - 1
end repeat
this assumes that you are copying from myList to myList2
hth,
richie
On Mon, 1 Dec 2003 15:40:30 +0000 (UTC), "minerale"
[email]webforumsuser@macromedia.com[/email] wrote:
>Is it possible to sort the contents of a list backwards?
>Put the values into an array the opposite way round?
>
>
>thanks
>m
>Richie Bisset Guest
-
ChiehAnLu webforumsuser@macromedia.com #4
Re: Sorting the contents of a list backwards
Director's array.sort() doesn't support sorting list backwards.
You have 2 other options which is comparable in speed.
1. You can take a look at [url]http://xtras.calu.us/articles1.php[/url] which has an article about sorting a list using the merge sort algorithm. With a little tweak on the > and < comparisons, and other minor changes, this will allow you to costomize your sorting algorithm.
2. call director's array.sort() on your list. then write a repeat loop that will traverse the list backward, and add each item into a new list. something like
nTotal = list.count
reverseList = []
repeat with i = ntotal down to 1
reverseList.addAt(list)
end repeat
Hope this helps
Chieh An Lu
ChiehAnLu webforumsuser@macromedia.com Guest
-
LukeWig #5
Re: Sorting the contents of a list backwards
On 2/12/03 2:40 AM, in article bqfnde$iqe$1@forums.macromedia.com,
"minerale" <webforumsuser@macromedia.com> wrote:
If speed is important, you can use the PRegEx_Reverse(aList) method provided> Is it possible to sort the contents of a list backwards?
> Put the values into an array the opposite way round?
by the free PregEX Xtra ([url]www.openxtras.org[/url]) - its not shockwave safe,
though.
Luke
LukeWig Guest



Reply With Quote

