clear item from array

[b][red]This message was edited by loiter at 2003-2-2 11:25:6[/red][/b][hr]
Hello,

I have a structured array that is being displayed in a listbox. I want the user to be able to click on an item and delete it from the listbox - thereby removing it from the array and making it available to hold new data. I am trying

i=listbox.selectedindex
array(i).item=""

Now, I know it isn't correct or else I wouldn't post. Could someone help me out by pointing me in the right direction?

thanks
j


Comments

  • Working with standard arrays is not fun. Try using an arraylist instead:

    dim data as arraylist
    .
    .
    .
    data.add() 'use this to fill your array
    .
    .
    .
    i = listbox.selectedindex
    data.removeAt(i) 'use this to remove the item from the array
    listbox.removeAt(i) 'use this to eliminate the item from the listbox

    Why don't you eliminate come of the overhead and just use the list box as the only source of this information? There is no need to have an array storing the information as well as a list box (they really are the same thing)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion