Page 1 of 1

addarray index out of bounds

Posted: Fri Jun 18, 2004 9:31 am
by 9080590
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

Posted: Tue Jun 22, 2004 10:51 pm
by Pep
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.

Posted: Wed Jun 23, 2004 9:55 am
by 9080590
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

Posted: Wed Jun 23, 2004 4:29 pm
by Pep
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..