Page 1 of 1

About the data size of AddArray function

Posted: Sun Jan 05, 2014 3:38 am
by 16566869
According to the description of AddArray function,
the second parameter means the data number of the first parameter?
But actrually it is the data number - 1 ?
So if I have a array of 10 elements,
I should add data like below?

Code: Select all

	double array[10] = {1, 2,3,4,5,6,7,8,9,10};
	Series1->AddArray(array, 9);

Re: About the data size of AddArray function

Posted: Tue Jan 07, 2014 3:47 pm
by yeray
Hello,

No, the two AddArray overrides are:

Code: Select all

{ Adds the Values array parameter into the series. }
Function TChartSeries.AddArray(Const Values:Array of TChartValue):Integer;

{ Adds the XValues and YValues arrays parameter into the series. }
Function TChartSeries.AddArray(Const XValues, YValues:Array of TChartValue):Integer;

Re: About the data size of AddArray function

Posted: Wed Jan 08, 2014 12:38 am
by 16566869
Then, what is the below one in FMXTee.Engine.hpp?

Code: Select all

int __fastcall AddArray(double const *Values, const int Values_Size)/* overload */;

Re: About the data size of AddArray function

Posted: Thu Jan 09, 2014 9:38 am
by narcis
Hi elmec,

I could reproduce it with both VCL and Firemonkey C++ Builder projects. It looks like a C++ Builder bug to me. So I have added it (ID531) to the bug list to be fixed.

Re: About the data size of AddArray function

Posted: Thu Jan 09, 2014 9:51 am
by 16566869
So what should I do ?

Just pass the (data size - 1) instead of the data size ?
Is there any side effect?

Re: About the data size of AddArray function

Posted: Thu Jan 09, 2014 12:34 pm
by narcis
Hi elmec,
elmec wrote:Just pass the (data size - 1) instead of the data size ?
Yes, that seems to be the way it works for now.
elmec wrote:Is there any side effect?
Not that I can think of right now.