addarray index out of bounds

TeeChart for ActiveX, COM and ASP
Post Reply
Jack007
Newbie
Newbie
Posts: 10
Joined: Thu Jan 22, 2004 5:00 am

addarray index out of bounds

Post by Jack007 » Fri Jun 18, 2004 9:31 am

To improve performance i'm experimenting with the addarray method. But nomatter what i do i allways get an "array index out of bounds" error.

The (simple) experiment code looks something like

local ax, ay as array (of usual) //dynamic arrays

ax:={1,2,3) //create x-value array + data
ay:={4,5,6} //create y-value array + data
self:odcTC:series(0):addarray(alen(ax),ax,ay) //alen() returns the length of the array 1-based.

My programming language (CA-Visual Objects 2.7a) is using 1-based arrays and not (the usual) 0-based arrays (and yes i also tried Alen(ax)-1, 2, 3 etc.).
Now on some news-groups i read that there were some issues about this when passing arrays to delphi code.
I'm using the latest V5.

TIA
Jack

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

Post by Pep » Tue Jun 22, 2004 10:51 pm

Hi Jack,

yes, you're correct, it only will work with 0-based arrays. In your case you will have to iterate through the Data Array and use the AddXY method to add the Data to the series.

Jack007
Newbie
Newbie
Posts: 10
Joined: Thu Jan 22, 2004 5:00 am

Post by Jack007 » Wed Jun 23, 2004 9:55 am

Well, i tought this was the case.

Now, I read on some newsgroups where the same problems were discussed that it was possible to "change something" in the Delphi code in order to read the 1-based arrays.
Is this true (and if so, would this be an enhancement for TC)?

Jack

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

Post by Pep » Wed Jun 23, 2004 4:29 pm

Hi Jack,

it's on our wish list to be reviewed for the next releases but I cannot tell for sure it will be done and when..

Post Reply