Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Getting my head around Unicode / Upgrading to Delphi 2010
Tue, Feb 2 2010 1:22 AMPermanent Link

"Adam H."
Hi,

I'm toying with the possibility of what will be required for me to
upgrade from Delphi 2007 to Delphi 2010.

From what I can tell the main problem will be Unicode strings vs Ansi
strings.

I have some large applications written using DBISam that will remain
ANSI string, but I was wondering - what happens if I try to port these
to Delphi 2010.

ie, if I have the following code:

var
s : string;
begin
s := 'This is some text in here';
DBISamTable1MyField1.value := s;
end;

Will this cause a performance loss because 's' is a Unicode String and
not an ANSI string? Should I be going through all my units, etc and
change string to ansistring?

Cheers

Adam.
Tue, Feb 2 2010 10:06 AMPermanent Link

"Raul"
Basically yes : use the AnsiString instead of String ; for TField data
access use the AsAnsiString function to  avoid conversions.

Rest of VCL is Unicode also so again look for conversion issues there but in
general it should work fine.

As always - test, test, test

Raul



"Adam H." <ahairsub5@removeme.jvxp.com> wrote in message
news:C5FFCB47-2FA5-4543-9CFE-B6AD788E6F3A@news.elevatesoft.com...
> Hi,
>
> I'm toying with the possibility of what will be required for me to upgrade
> from Delphi 2007 to Delphi 2010.
>
> From what I can tell the main problem will be Unicode strings vs Ansi
> strings.
>
> I have some large applications written using DBISam that will remain ANSI
> string, but I was wondering - what happens if I try to port these to
> Delphi 2010.
>
> ie, if I have the following code:
>
> var
> s : string;
> begin
> s := 'This is some text in here';
> DBISamTable1MyField1.value := s;
> end;
>
> Will this cause a performance loss because 's' is a Unicode String and not
> an ANSI string? Should I be going through all my units, etc and change
> string to ansistring?
>
> Cheers
>
> Adam.
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4828 (20100202) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4828 (20100202) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


Tue, Feb 2 2010 10:09 AMPermanent Link

adam
I am considering the same conversion myself.

I have been told there is an "assessment utility" available from CodeGear which will run
through your code & spot areas which might have issues.

Honestly I don't know any more than this, but a colleague has used it and said it worked.
I will definitely be running it over my code prior to any conversion process.
Tue, Feb 2 2010 11:01 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

adam

>I have been told there is an "assessment utility" available from CodeGear which will run
>through your code & spot areas which might have issues.

If your colleague has a link can you post it please.

Roy Lambert
Tue, Feb 2 2010 12:39 PMPermanent Link

Dan Rootham
Roy,

>> If your colleague has a link can you post it please.

It's called the "Unicode Statistics Tool", available on the Embarcadero Developer Network:
 http://cc.embarcadero.com/item/27398

Regards,
Dan
_________________
Lexicon Software Ltd
Tue, Feb 2 2010 2:21 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Dan


Thanks

Roy Lambert
Image