Clear TChartValues

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
PoLabs
Newbie
Newbie
Posts: 35
Joined: Fri Feb 05, 2010 12:00 am

Clear TChartValues

Post by PoLabs » Thu Nov 22, 2012 1:37 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Clear TChartValues

Post by Narcís » Thu Nov 22, 2012 2:44 pm

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

PoLabs
Newbie
Newbie
Posts: 35
Joined: Fri Feb 05, 2010 12:00 am

Re: Clear TChartValues

Post by PoLabs » Thu Nov 22, 2012 3:53 pm

I found the problem. Thanks.

Post Reply