Hi guys.
I'm having a problem writing Statistica Visual Basic macro.
Look at the code:
Dim har () As Double, sample () As Double, card As Byte
...
ReDim har (1 To S1.NumberOfVariables) As Double
'S1 is active spreadsheet
...
ReDim Preserve sample(1 To card) As Double
ValStDeviation (sample, 1, card, har(j))
I get "Expecting already dimensioned array" error.
If one looks at ValStDeviation function description it is as follows:
ValStDeviation(ByRef arr() As Double, ByVal Start As Long, ByVal Count As Long, ByRef result As Double) As Long
The ValStDeviation function returns the standard deviation of the values from among the specified number of array elements beginning with the specified element and places in the result variable.
Any thoughts on why this error might occur ?
Thanks in advance.




Reply With Quote