Page 1 of 1

Clear TChartValues

Posted: Thu Nov 22, 2012 1:37 pm
by 10055200
Hi,

I have very strange errors in my SW and I am not sure what I am doing wrong. Well I am using some variables of TChartValues data type and I would like to clear data in that array. What is the proper way to do that? The Way I am doing it now it is not working ok?

Code: Select all

Var1: TChartValues;
Var2: TChartValues;

SetLength(Var1, 1024);
SetLength(Var2, 2056);


// init array
FillChar(var1, 1024 * sizeOf(TChartValue), 0);  ///--> makes error
FillChar(var2, 2056 * sizeOf(TChartValue), 0);  ///--> makes error

// ... more coder
...

THANKS FOR YOUR HELP!

BR

Re: Clear TChartValues

Posted: Thu Nov 22, 2012 2:44 pm
by narcis
Hi BR,

That's a Delphi issue, not a TeeChart issue. The same occurs using Array of Double.

Code: Select all

var
  //Var1: TChartValues;
  //Var2: TChartValues;
  X: Array of Double;
  Y: Array of Double;
begin
  SetLength(Var1, 1024);
  SetLength(Var2, 2056);


  // init array
  FillChar(var1, 1024 * sizeOf(X), 0);  ///--> makes error
  FillChar(var2, 2056 * sizeOf(Y), 0);  ///--> makes error
You can use arrays with TeeChart series as shown in the real-time Charting example here.

Hope this helps.

Re: Clear TChartValues

Posted: Thu Nov 22, 2012 3:53 pm
by 10055200
I found the problem. Thanks.