AddArray problem
Posted: Wed Oct 13, 2004 12:27 pm
Dear Support
I have newbie like question:
Uppon adding a simple array to the chart with the AddArray method, i get the following error message:
"Variant or safe array index out of bounds"
The following simple VB code wo'nt work:
Dim X_ARRAY(10) As Single
Dim Y_ARRAY(10) As Single
Dim I As Integer
Randomize
For I = 1 To 10
X_ARRAY(I) = CSng(I)
Y_ARRAY(I) = Rnd * 10#
Debug.Print I, Y_ARRAY(I)
Next I
' Now add it to the chart.
frmAddArray.TChart1.AddSeries scLine
frmAddArray.TChart1.Series(0).AddArray UBound(Y_ARRAY), Y_ARRAY(), X_ARRAY()
'
What can be the problem?
Tx in advance, regards
Andras
I have newbie like question:
Uppon adding a simple array to the chart with the AddArray method, i get the following error message:
"Variant or safe array index out of bounds"
The following simple VB code wo'nt work:
Dim X_ARRAY(10) As Single
Dim Y_ARRAY(10) As Single
Dim I As Integer
Randomize
For I = 1 To 10
X_ARRAY(I) = CSng(I)
Y_ARRAY(I) = Rnd * 10#
Debug.Print I, Y_ARRAY(I)
Next I
' Now add it to the chart.
frmAddArray.TChart1.AddSeries scLine
frmAddArray.TChart1.Series(0).AddArray UBound(Y_ARRAY), Y_ARRAY(), X_ARRAY()
'
What can be the problem?
Tx in advance, regards
Andras