Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread OT: AnsiString vs String
Mon, Jul 12 2010 12:03 PMPermanent Link

JonD

Finally starting to use D2009.  I understand the distinction
between AnsiString and String, but...

I'm attempting to convert a major application from D2006
and am substituting AnsiString and AnsiChar for String and Char
and doing a lot of explicit casting.

But as I move forward my question is:
   Should I use String where ever possible as a default
   or should I just continue with AnsiString/AnsiChar

The application is not in need of Unicode features.

Thanks for any insights.

Maybe I should just go back to TurboPascal 1.0 ( Smile)

JonD

Mon, Jul 12 2010 12:40 PMPermanent Link

David Cornelius

Cornelius Concepts

Avatar

Things were so much simpler then!  I miss Turbo Pascal...

My approach in D2009 has been to just use the default string type and
not make explicit types to lock me in to non-unicode types.  I suppose
that if you have a loop that takes a long time or lots of memory, it
might make sense to use the more efficient but less flexible AnsiString,
but I imagine that in most cases, it will be negligible.

Using string and char seems a lot more compatible.  And 3rd-party
components will likely use the Unicode-friendly types, not to mention
many parts of the VCL.

--
David Cornelius
Cornelius Concepts

On 7/12/2010 9:03 AM, Jon Lloyd Duerdoth wrote:
> Finally starting to use D2009.  I understand the distinction
> between AnsiString and String, but...
>
> I'm attempting to convert a major application from D2006
> and am substituting AnsiString and AnsiChar for String and Char
> and doing a lot of explicit casting.
>
> But as I move forward my question is:
>      Should I use String where ever possible as a default
>      or should I just continue with AnsiString/AnsiChar
>
> The application is not in need of Unicode features.
>
> Thanks for any insights.
>
> Maybe I should just go back to TurboPascal 1.0 ( Smile)
>
> JonD
>
>
Mon, Jul 12 2010 3:17 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Jon,

<< But as I move forward my question is:
Should I use String where ever possible as a default or should I just
continue with AnsiString/AnsiChar >>

Just use String everywhere.

--
Tim Young
Elevate Software
www.elevatesoft.com
Mon, Jul 12 2010 6:26 PMPermanent Link

JonD

String/Char it is!

Thanks for the advice.

JonD

On 2010-07-12 12:03 PM, Jon Lloyd Duerdoth wrote:
> Finally starting to use D2009.  I understand the distinction
> between AnsiString and String, but...
>
> I'm attempting to convert a major application from D2006
> and am substituting AnsiString and AnsiChar for String and Char
> and doing a lot of explicit casting.
>
> But as I move forward my question is:
>     Should I use String where ever possible as a default
>     or should I just continue with AnsiString/AnsiChar
>
> The application is not in need of Unicode features.
>
> Thanks for any insights.
>
> Maybe I should just go back to TurboPascal 1.0 ( Smile)
>
> JonD
>
>
Image