Page 1 of 1

persisting AddArray problem

Posted: Wed Oct 27, 2004 4:59 pm
by 9524558
Dear Support

I've upgraded to TChart V7, and hoped that my previous AddArray problem will disappear. Unfortunately not. :cry:

So I still face the problem, that by using the AddArray feature an error message comes up: Run-time error: -2147418113 (8000ffff)

"Variant or safe array index out of bounds"

The simple VB6 code below results the message above. What might be the problem?

Tx in advance, Andras



Dim X_ARRAY(10) As Double
Dim Y_ARRAY(10) As Double
Dim I As Integer
'
Randomize
For I = 1 To 10
'
X_ARRAY(I) = CSng(I)
Y_ARRAY(I) = Rnd * 10#
'
Next I
'
' Now add it to the chart.
'
frmAddArray.TChart1.AddSeries scLine
frmAddArray.TChart1.Series(0).AddArray UBound(Y_ARRAY), Y_ARRAY(), X_ARRAY()
'

Posted: Thu Oct 28, 2004 2:18 pm
by Pep
Hi Andras,

I've posted one example using your code into the steema.public.attachments newsgroup with which I cannot get the error (with the latest v7.02) . Could you please check if it works for you ?
Also, I must tell you that TeeChart does no allow to read 1 based Arrays. I that case it will add a 0 value for the first index (0).

Posted: Thu Oct 28, 2004 5:27 pm
by 9524558
Pep wrote:Hi Andras,

I've posted one example using your code into the steema.public.attachments newsgroup with which I cannot get the error (with the latest v7.02) . Could you please check if it works for you ?
Also, I must tell you that TeeChart does no allow to read 1 based Arrays. I that case it will add a 0 value for the first index (0).
Pep you're a champion! I had Option Base 1 in the declaration section. As soon as I've changed it to Option Base 0, it started working. You're hero!! Now part of my code will be much faster. Thank you very much!

best regards

Andras

Posted: Fri Oct 29, 2004 10:08 am
by Pep
Hi Andras,

I'm glad to hear this ! :wink: