ARC
Well-known member
This is set up with the ability to add and remove user names from a listbox. Below, I have this in the Remove User code in order to shift all the data past the tempIndex (the index that was removed) all the way up to the last entry, all down 1.
Because totalUsers provides a value that's +1 than the length of the LoginArray (because the array holds 0 as it's first cell), I resize the LoginArray by using the totalUsers variable. The question I have then, i have then is, will this simply delete the last cell of the array and all the info in it? I guess I'm assuming that if you resize an array that's 6 length down to a 5 length that it'll just get rid of that 6th cell and all the data in it.
Because totalUsers provides a value that's +1 than the length of the LoginArray (because the array holds 0 as it's first cell), I resize the LoginArray by using the totalUsers variable. The question I have then, i have then is, will this simply delete the last cell of the array and all the info in it? I guess I'm assuming that if you resize an array that's 6 length down to a 5 length that it'll just get rid of that 6th cell and all the data in it.
VB.NET:
For i = tempIndex To totalUsers Step 1
LoginArray(i).Name = LoginArray(i + 1).Name
LoginArray(i).Pass = LoginArray(i + 1).Pass
Next i
ReDim Preserve LoginArray(totalUsers - 1)
totalUsers -= 1
Last edited: