Recently I download Codegear RAD Studio trial version to try upgarade our
Delphi 7 desktop application. I copied my source code to a new folder, when
building I got "[DCC Error] DataManagement.pas(319): E2003 Undeclared
identifier: 'VarToStr'.
Checking with Delphi 7 I know the VarToStr function is defined in
Variants.pas/dcu under "Program files\borland\delphi7\source\rtl\sys folder.
But there is no such a folder for Delphi 2007, though there is a
Variants.dcu file under D:\Program Files\CodeGear\RAD Studio\5.0\lib
instead. I don't understand why the Variants.dcu not works.
I also copied the Rtl folder to D:\Program Files\CodeGear\RAD
Studio\5.0\source\Rtl, but go more errors.
Could anybody shed me the light on this problem? Thanks.
Chris
> Recently I download Codegear RAD Studio trial version to try upgarade our
> Delphi 7 desktop application. I copied my source code to a new folder, when
> building I got "[DCC Error] DataManagement.pas(319): E2003 Undeclared
> identifier: 'VarToStr'.
Have you added the Variants unit to the uses clause of DataManagement.pas ?
> Checking with Delphi 7 I know the VarToStr function is defined in
> Variants.pas/dcu under "Program files\borland\delphi7\source\rtl\sys folder.
> But there is no such a folder for Delphi 2007, though there is a
> Variants.dcu file under D:\Program Files\CodeGear\RAD Studio\5.0\lib
> instead. I don't understand why the Variants.dcu not works.
It may work - is it actually part of the uses clause?
> I also copied the Rtl folder to D:\Program Files\CodeGear\RAD
> Studio\5.0\source\Rtl, but go more errors.
Which RTL folder? Of Delphi 7? That's not a good idea of course (you
should not mix RTL source from different versions of Delphi)...
> Chris
Groetjes,
Bob Swart
--
Bob Swart Training & Consultancy (eBob42.com) Forever Loyal to Delphi
CodeGear Technology Partner -- CodeGear RAD Studio Reseller (BeNeLux)
Blog: http://www.drbob42.com/blog - RSS: http://eBob42.com/weblog.xml
uses
Classes, Sysutils,
{$IFDEF VER140} Variants, {$ENDIF VER140}
{$IFDEF VER150} Variants, {$ENDIF VER150}
FrameWork, ADODB_TLB, ComObj, IDAllocation, Dialogs;
It seems in Delphi 2007 it doesn't define VERSION140 or 150 anymore.
Now I can build the project in the Delphi 2007. Thanks again.
Chris
"Bob Swart" <B...@eBob42.com> wrote in message
news:478CA965...@eBob42.com...
> it turns out the conditional directive in the unit:
>
> uses
> Classes, Sysutils,
> {$IFDEF VER140} Variants, {$ENDIF VER140}
> {$IFDEF VER150} Variants, {$ENDIF VER150}
> FrameWork, ADODB_TLB, ComObj, IDAllocation, Dialogs;
>
> It seems in Delphi 2007 it doesn't define VERSION140 or 150 anymore.
That's correct - VER140 was for Delphi 6 and VER150 for Delphi 7.
Delphi 2007 is using VER180 ;-)