D - Dinamic array remove element
- Ant (5/5) Sep 21 2003 How do we remove an element from a dimamic array?
-
Carlos Santander B.
(34/34)
Sep 21 2003
"Ant"
wrote in message - Ant (9/12) Sep 21 2003 I're right. Actually my real code is:
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
Sep 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
Sep 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) orI'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
Sep 21 2003