Groups > Borland > Borland Delphi migration > Re: Migration Windows Application From Delphi 7 to Delphi 2007 for




Migration Windows Application From Delphi 7 to Delphi 2007
for Win32

Migration Windows Application From Delphi 7 to Delphi 2007 for Win32
Mon, 14 Jan 2008 21:41:14 -050
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 

Post Reply
Re: Migration Windows Application From Delphi 7 to Delphi 2007 for
Tue, 15 Jan 2008 13:39:01 +010
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)
Post Reply
Re: Migration Windows Application From Delphi 7 to Delphi 2007 for Win32
Wed, 16 Jan 2008 19:33:58 -050
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" <Bob@eBob42.com> wrote in message 
news:478CA965.9050106@eBob42.com...
> 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 

Post Reply
Re: Migration Windows Application From Delphi 7 to Delphi 2007 for
Thu, 17 Jan 2008 09:15:58 +010
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 ;-)

> Chris

Groetjes,
           Bob Swart

-- 
Bob Swart Training & Consultancy (eBob42.com) Forever Loyal to Delphi
CodeGear Technology Partner -- CodeGear RAD Studio Reseller (BeNeLux)
Post Reply
about | contact