Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change LBound of array
I have a (1,1) based array which i want to turn into (0,0) based array,
how do I do this quickly? I think it should simply be a matter of changing some parameters in the corresponding SAFEARRAY structure, but I don't know how to do this without causing crashes. Doing this any other way that actually requires moving the data of the array in memory is unacceptable. Any help would be appreciated! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change LBound of array
Have you tired Option Base. Here is a link to the article
http://msdn.microsoft.com/library/de...OptionBase.asp HTH "R Avery" wrote: I have a (1,1) based array which i want to turn into (0,0) based array, how do I do this quickly? I think it should simply be a matter of changing some parameters in the corresponding SAFEARRAY structure, but I don't know how to do this without causing crashes. Doing this any other way that actually requires moving the data of the array in memory is unacceptable. Any help would be appreciated! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change LBound of array
This happens when i do
dim rng as excel.range dim vnt as variant set rng=selection vnt=rng then vnt will be a (1,1) based array, regardless of the OPTION BASE statement. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change LBound of array
R Avery wrote:
This happens when i do dim rng as excel.range dim vnt as variant set rng=selection vnt=rng then vnt will be a (1,1) based array, regardless of the OPTION BASE statement. Why is it unacceptable to "move the data of the array in memory" to make the change to 0 base in both dimentions? Alan Beban |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change LBound of array
because i know that its possible with a few API calls to change the
base of the SAFEARRAY without having to move the actual data in memory anywhere. The reason its unacceptable is that it's too slow. I'm loading like 100 MB of Excel data at a time into an array, many times, and copying the data to a whole new array would impact performance. It has to be zero-based because i force all my objects to have zero-based collections and arrays in order to avoid confusion. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can't change part of an array | Excel Worksheet Functions | |||
change array to simple columns | Excel Discussion (Misc queries) | |||
How to change this into array ? | Excel Programming | |||
How to change this into array ? | Excel Programming | |||
Ubound & Lbound | Excel Programming |