03-27-2006 05:42 AM
03-29-2006 03:58 AM
03-29-2006 08:17 AM
My first problem was just in the general use of the control,
I was expecting it to do an "in place" decimation on the
input parameter, rather than giving the data back as the
return val.
I know I should have read the help more closely, but a
1 line example of its usage would have made things
immediately more clear.
Subsequent problem was that it keeps failing with an out
of memory error "Runtime error 61706: Insufficient memory
to perform operation", even though there is free memory available
on the PC and I can create a new variable of the same size
with out problem. Code below
Any ideas what I'm doing wrong or just a limit on VB or the controls?
Paul
Option Explicit
Const cBigArraySize As Long = 60000000
Const cSmallArraySize As Long = 30000000
Dim gIntegerArray(cBigArraySize) As Long
Private Sub Command1_Click()
Dim TempArray() As Long
' TempArray = CWDSP1.Decimate(gIntegerArray, 2, 1) <-This call always fails
Dim LoopCounter As Long
Dim TempArrayIndex As Long
ReDim TempArray(cSmallArraySize) As Long <-though this always succeeds!
TempArrayIndex = 0
For LoopCounter = 0 To cBigArraySize Step 2
TempArray(TempArrayIndex) = gIntegerArray(LoopCounter)
TempArrayIndex = TempArrayIndex + 1
Next LoopCounter
Debug.Print "IntegerArray(0) = " & gIntegerArray(0) & " a(0) = " & TempArray(0)
Debug.Print "IntegerArray(0) = " & gIntegerArray(cBigArraySize) & " a(0) = " & TempArray(cSmallArraySize)
End Sub
Private Sub Form_Load()
Dim LoopCounter As Long
For LoopCounter = 0 To cBigArraySize
gIntegerArray(LoopCounter) = Rnd() * 100
Next LoopCounter
End Sub
03-29-2006 10:07 AM