Re: Arrays: Removing Items
The proper way is to move everything ABOVE the item down 1 slot, and then resize the array. It's relatively simple, but does take a little coding. In place of using an actual Array, I recommend you use a List(of T) instead.
Re: Arrays: Removing Items
That wont work as I need everything else in the array to stay where it is
Re: Arrays: Removing Items
I also can't use the list as i'm using a two dimensional array
Re: Arrays: Removing Items
What type are you putting into the array then? Why are you using a single dimension in code if it's multi-dimensional?
Re: Arrays: Removing Items
The array contains graphics from a class that i have created. I was just using that code as an example what i'm actually doing is:
Code:
Blocks(TestPosition.X, TestPosition.Y) = Nothing
Re: Arrays: Removing Items
What your "problems with my program".
Re: Arrays: Removing Items
Basically I am setting certain items in the array to nothing and when rendering all blocks in the array to the screen its still displaying the items that have been set to nothing. I have put breakpoints on my code and I checked the array and the items are set to nothing so im not sure why it's still drawing the blocks.
Re: Arrays: Removing Items
Then maybe it's a problem with your code somewhere else
Re: Arrays: Removing Items
Ye that's what I was thinking but im starting to loose hope i've been through my code lots of times and still can't figure out why. If i'm removing blocks that were originally in the array then it works fine but if im removing a block that was added to the array then it sets it to nothing but still display it on screen.
Re: Arrays: Removing Items
maybe we could help you if we saw your code?