ID:136945
 
Could an insert proc be added to lists? It would eliminate the need to manually bump all the contents of the list past the inserted object.
English wrote:
Could an insert proc be added to lists? It would eliminate the need to manually bump all the contents of the list past the inserted object.

I've been requesting Insert() and Swap() for some time now.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
English wrote:
Could an insert proc be added to lists? It would eliminate the need to manually bump all the contents of the list past the inserted object.

I've been requesting Insert() and Swap() for some time now.

Lummox JR

It's not as nice as having them built in, but I have a proc for swapping I've written, if anyone's interested. It's written for swapping objects in an inventory, but could easily be adjusted for any list.
In response to Lummox JR
The one time I don't search the forum first it ends up being something that was requested before :p

Oh well, I guess it can't hurt to job their memories :)

What I was just using it for actually isn't that complicated of a case but there have been times where it would have been usefull before. I just need to take what is on the end of the list and put it in the front which can be accomplished easily with something like this:

var/temp = L[L.len]
L = list(temp) + (L - temp)
In response to Lummox JR
To be honest, I'd love it if all of the procs in my ListHelp library were made obsolete by hardcode.