persisting AddArray problem

TeeChart for ActiveX, COM and ASP
Post Reply
Andras
Newbie
Newbie
Posts: 40
Joined: Thu Oct 14, 2004 4:00 am
Location: Hungary

persisting AddArray problem

Post by Andras » Wed Oct 27, 2004 4:59 pm

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()
'

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Oct 28, 2004 2:18 pm

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).

Andras
Newbie
Newbie
Posts: 40
Joined: Thu Oct 14, 2004 4:00 am
Location: Hungary

Post by Andras » Thu Oct 28, 2004 5:27 pm

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

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Oct 29, 2004 10:08 am

Hi Andras,

I'm glad to hear this ! :wink:

Post Reply