Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Migration Windows Application From Delphi 7 to Delphi 2007 for Win32

132 views
Skip to first unread message

Chris

unread,
Jan 14, 2008, 9:41:14 PM1/14/08
to
Hi,

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


Bob Swart

unread,
Jan 15, 2008, 7:39:01 AM1/15/08
to
Hi 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

Chris

unread,
Jan 16, 2008, 7:33:58 PM1/16/08
to
Thank a lot, Bob!
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.

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

Bob Swart

unread,
Jan 17, 2008, 3:15:58 AM1/17/08
to
Hi Chris,

> 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 ;-)

0 new messages