Thread overview
Dinamic array remove element
Sep 21, 2003
Ant
Sep 21, 2003
Ant
September 21, 2003
How do we remove an element from a dimamic array?

slicing?

a = a[0..4] ~ a[6..a.length]

this works. is this it?

Ant


September 21, 2003
"Ant" <Ant_member@pathlink.com> wrote in message
news:bkl63u$1d4n$1@digitaldaemon.com...
| How do we remove an element from a dimamic array?
|
| slicing?
|
| a = a[0..4] ~ a[6..a.length]
|
| this works. is this it?
|
| Ant
|
|

No, actually. That should be [0..4]~[5..length] (for the 5th element) or
[0..5]~[6..length] (for the 6th).

—————————————————————————
Carlos Santander
"Ant" <Ant_member@pathlink.com> wrote in message
news:bkl63u$1d4n$1@digitaldaemon.com...
| How do we remove an element from a dimamic array?
|
| slicing?
|
| a = a[0..4] ~ a[6..a.length]
|
| this works. is this it?
|
| Ant
|
|

No, actually. That should be [0..4]~[5..length] (for the 5th element) or
[0..5]~[6..length] (for the 6th).

————————————————————————— Carlos Santander


September 21, 2003
In article <bklaf6$1j2s$1@digitaldaemon.com>, Carlos Santander B. says...
>
>"Ant" <Ant_member@pathlink.com> wrote in message
>| a = a[0..4] ~ a[6..a.length]

>No, actually. That should be [0..4]~[5..length] (for the 5th element) or

I're right. Actually my real code is:
listRows = listRows[0..row] ~ listRows[row+1..listRows.length];

And I just changed it to:

listRows[row..listRows.length-1] = listRows[row+1..listRows.length]; listRows.length = listRows.length-1;

//--(listRows.length); -->> not an lValue. shouldn't it be?


is it be more efficient?

Ant