Page 1 of 1

Determine TeeChart version during compile?

Posted: Thu Nov 01, 2007 3:36 am
by 10547054
I purchased V8 for my main machine, but I have not yet purchased a second copy for my notebook yet, so I am still running V4 on that PC.

Can I use an IFDEF to hide code that only compiles in V8?

I tried IFDEF TeeChart8 without success.

Thanks, Steve

Posted: Wed Nov 07, 2007 12:55 pm
by Pep
Hi Steve,

you can check which TeeChart Pro version is using with the TeeChartVersion constant defined at TeeConst.pas :

TeeChartVersion =String('8');

Code: Select all

Uses TeeConst :

if TeeChartVersion <> '8'  then
 ...

Detecting TeeChart Version at Compile time

Posted: Wed Nov 07, 2007 1:02 pm
by 10547054
I think that will work during run time, but there are methods, procedures, etc available in TeeChart 8 that are not available in earlier versions. I would like to wrap my new code around IFDEF statements so it will still compile on a PC with older versions of TeeChart.

Thanks for the reply.

Steve

Posted: Wed Nov 07, 2007 4:28 pm
by Pep
Hi Steve,

in that case you can use (with Delphi7 and above) the following :

Code: Select all

uses
  TeeConst;

procedure TForm1.FormCreate(Sender: TObject); 
begin 
{$IF TeeChartVersion='8'}
  Caption:='Eight';
{$ELSE}
  Caption:='Seven';
{$IFEND}
end;

Checking TeeChart Version at Compile

Posted: Wed Nov 07, 2007 8:21 pm
by 10547054
Perfect - exactly what I needed.

Thanks you very much.

Steve