I have the following Arrays:
Names () As String
Salaries() As Decimal
Names(0) = "Bob" Salaries(0) = "100"
Names(1) = "Fred" Salaries(1) = "200"
Names(2) = "Jack" Salaries(2) = "300"
Now I have a variable called intLocation that keeps track of where I am in the array, and I present the user with an input box that says "Enter the name of the person you want to delete"
Now I figure I can write a For Loop to cycle through the array and find the person I am looking for (save array index to intLocation?). Now I've got to delete that person and their salary from the arrays......
It would do me no good to just simply write for example Names(1) = String.Empty and Salaries(1) = String.Empty
because then if I write the data on the screen, I would see a gap in my list.....
So the question is, if I wanted to delete Fred from the array and his salary of 100, how would I move up Jack and his salary where Fred used to be along with any other data that may be below Jack that would also have to be moved up by 1?
Enter your message below
Sign in or Join us (it's free).