Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an array of strings that is fed into an external function in a
COM. I've found that the code inside has a "break point" where too many strings suddenly makes it run much slower (memory problem?). If you call the code with batches of strings it runs much faster. So how do I do this? I have a "securities(0 to records -1)", and I want to break that down into chunks of no more than 50 at a time. The last array cannot have any empty cells at the end. I thought of using a comma-delimited string of everything in "securities" and then using Split, but that would always return the first 50 strings, without some string manipulation anyway. Maury |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maury Markowitz wrote:
I have an array of strings that is fed into an external function in a COM. I've found that the code inside has a "break point" where too many strings suddenly makes it run much slower (memory problem?). If you call the code with batches of strings it runs much faster. So how do I do this? I have a "securities(0 to records -1)", and I want to break that down into chunks of no more than 50 at a time. The last array cannot have any empty cells at the end. I thought of using a comma-delimited string of everything in "securities" and then using Split, but that would always return the first 50 strings, without some string manipulation anyway. Hi Maury, Set up a couple loops to control the paging. Here's a rough sketch: 'Outer loop For j = 0 to arraysize\50 PageOffset = j * 50 'Inner loop For k = 0 to 49 TargetIndex = PageOffset + k ' check to make sure TargetIndex is not past the end of the array ' if ok, add item MyArray(TargetIndex) to the batch Next k 'Now the batch is built. Call the COM Next j |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
So, what is the problem then with passing the first 50 array elements, then
the second 50 array elements etc., adjusting for the last lot of elements? You could pass them in a 50 element array, again adjusting for the last bit. RBS "Maury Markowitz" wrote in message ... I have an array of strings that is fed into an external function in a COM. I've found that the code inside has a "break point" where too many strings suddenly makes it run much slower (memory problem?). If you call the code with batches of strings it runs much faster. So how do I do this? I have a "securities(0 to records -1)", and I want to break that down into chunks of no more than 50 at a time. The last array cannot have any empty cells at the end. I thought of using a comma-delimited string of everything in "securities" and then using Split, but that would always return the first 50 strings, without some string manipulation anyway. Maury |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sum parts of a column | Excel Discussion (Misc queries) | |||
breaking down a whole number into pre-defined parts.. | Excel Discussion (Misc queries) | |||
Redimming an array dynamically assigned from range (how to redim first dimension of a 2-D array? /or/ reverse the original array order) | Excel Programming | |||
i have two parts of a solution but can still not get it to run | Excel Programming | |||
Totalling Sum of Parts in a 2 column array. | Excel Discussion (Misc queries) |