quick and easy way to reverse a tlist ?

BlitzMax Forums/BlitzMax Programming/quick and easy way to reverse a tlist ?

Robert Cummings(Posted 2005) [#1]
Hi,

I would like to reverse the order of the elements in a TList. Is there a really efficient or simple way of doing this?


DocFritz(Posted 2005) [#2]
Isn't there a command like Swaplist or something? I'm sure, I've seen something like this in the bmax-help. Just look around in TList-Area.
I guess it isn't very fast. I'd recommend you to use two lists, one forward one reversed and update them simultaneously.


tonyg(Posted 2005) [#3]
Function ReverseList(mylist)
Method Reverse:Tlist
Method Reversed:Tlist (creates new 'reversed' list.


Tom Darby(Posted 2005) [#4]
From the docs:

Function ReverseList( list:TList ) Reverse the order of elements of a list


Robert Cummings(Posted 2005) [#5]
thank you :)