Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array Question

Status
Not open for further replies.

caseye

IS-IT--Management
Feb 7, 2002
52
US
How do I remove an item from an array so that the array will re index Moving the Items after the removed index back?

Thanx in advanced
[morning]
 
The old shell game. Use a temporary array of the same type.

1. redim the temp array to the size of the original array.
2. Place all values from the original array into the temp array.
3. redim the original array to one element less than it was before.
4. Place all values from the temp array back to the original array EXCEPT the one you want to remove.

Thanks and Good Luck!

zemp
 
Thank you. I assumed it would re index the array but i was wrong
 
I*f your array is simplistic (e,g, one dimension / list of values) you could (perhaps) use a collection instead of the array

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
When working with a strings or 1D arrays using the Split, Join, Filter, and Replace functions make things much easier....
In this case, using the Filter function is very simple and fast, needing only one line of code!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top