Determine TeeChart version during compile?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
vas
Newbie
Newbie
Posts: 20
Joined: Wed Oct 17, 2007 12:00 am

Determine TeeChart version during compile?

Post by vas » Thu Nov 01, 2007 3:36 am

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

Pep
Site Admin
Site Admin
Posts: 3299
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Nov 07, 2007 12:55 pm

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
 ...

vas
Newbie
Newbie
Posts: 20
Joined: Wed Oct 17, 2007 12:00 am

Detecting TeeChart Version at Compile time

Post by vas » Wed Nov 07, 2007 1:02 pm

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

Pep
Site Admin
Site Admin
Posts: 3299
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Nov 07, 2007 4:28 pm

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;

vas
Newbie
Newbie
Posts: 20
Joined: Wed Oct 17, 2007 12:00 am

Checking TeeChart Version at Compile

Post by vas » Wed Nov 07, 2007 8:21 pm

Perfect - exactly what I needed.

Thanks you very much.

Steve

Post Reply