![]() |
ResizeArray for Alan Question
Alan -
I'm using the ResizeArray in conjunction with a pair of Listboxes. The first Listbox allows for multiselction, the second does not. Users are selecting items in the listboxes and then as they get selected, they are moved off the list. I am then taking those items out of the list by rebuilding the list w/o the items that were just selected and then Resizing the Array before I pass it to the listbox again. I've come across an odd issue that has to do with the fact that I'm using the 0 value in the array (e.g. Array(0)=....). When I get down to 1 value being left, I'm passing this to the ResizeArray... Resize Array RemainderArray,1 Items-1,1 The problem is then that Items-1 = 0 which when resized, I do get back RemainderArray(0) = to what it should be, but it leaves RemainderArray(1) = to whatever it was set to prior to the Resizing. I'd rather not change my code to Option Base 1 because the logic is spread through hundreds of lines of code. Is it possible that the ResizeArray doesn't like an array of this size or am I resizing it incorrectly. Thanks Marston |
ResizeArray for Alan Question
I'm not understanding
Resize Array RemainderArray,1 Items-1,1 Is it supposed to be ResizeArray rather than Resize Array? What is 1 Items-1? is it supposed to be 1, Items-1? Is RemainderArray at this point a three dimensional array? What are its dimensions and to what are you expecting to change them? Alan Beban Marston wrote: Alan - I'm using the ResizeArray in conjunction with a pair of Listboxes. The first Listbox allows for multiselction, the second does not. Users are selecting items in the listboxes and then as they get selected, they are moved off the list. I am then taking those items out of the list by rebuilding the list w/o the items that were just selected and then Resizing the Array before I pass it to the listbox again. I've come across an odd issue that has to do with the fact that I'm using the 0 value in the array (e.g. Array(0)=....). When I get down to 1 value being left, I'm passing this to the ResizeArray... Resize Array RemainderArray,1 Items-1,1 The problem is then that Items-1 = 0 which when resized, I do get back RemainderArray(0) = to what it should be, but it leaves RemainderArray(1) = to whatever it was set to prior to the Resizing. I'd rather not change my code to Option Base 1 because the logic is spread through hundreds of lines of code. Is it possible that the ResizeArray doesn't like an array of this size or am I resizing it incorrectly. Thanks Marston |
All times are GMT +1. The time now is 01:17 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com