Remove more than one element….

Post your questions and help other users.

Moderator: Martin

Post Reply
User avatar
schuster666
Posts: 52
Joined: 13 Nov 2013 14:03
Location: Germany / Neuss

Remove more than one element….

Post by schuster666 » 21 Dec 2015 16:36

at a time from list.

Hi, is this possible?
I want to remove list index from 0 to 307 or 0 to {variable}.

Thanks for your help.
-- the world would be better without people--
-- but boring --

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Remove more than one element….

Post by MURTUMA » 21 Dec 2015 17:16

First define how many elements you want to delete and check the list length. Then use while loop.

while (list length >= original list length - elements to delete)
{Delete elements}

User avatar
schuster666
Posts: 52
Joined: 13 Nov 2013 14:03
Location: Germany / Neuss

Re: Remove more than one element….

Post by schuster666 » 21 Dec 2015 17:28

That is what i'm doing. I hoped that there is another solution.

Thank you
-- the world would be better without people--
-- but boring --

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Remove more than one element….

Post by Martin » 21 Dec 2015 19:56

It's the only way to remove elements at a specific index for now. I'll add a function to remove a range.

User avatar
schuster666
Posts: 52
Joined: 13 Nov 2013 14:03
Location: Germany / Neuss

Re: Remove more than one element….

Post by schuster666 » 21 Dec 2015 21:24

Thank you Martin
-- the world would be better without people--
-- but boring --

Post Reply