[Lazarus] Can't compile trunk with fpc 2.4.5 under ubuntu

Michael Schnell mschnell at lumino.de
Wed Feb 29 08:38:16 CET 2012


On 02/28/2012 02:43 PM, Sven Barth wrote:
> And with the way I described we can at least provide a type that 
> handles similar to good old AnsiString, but will continue to work even 
> if String should be changed to UnicodeString in the future.
I just did a component using Delphi < 2009 (as I don't have a greater 
version) and gave it to a colleague that uses XE2 who will implement it 
in his project.

I did

Type
   ByteString = ANSIString.
   {$if UNICODE}
     TByteStringList = TANSIStringList;
    {$else}
     TByteStringList = TStringList;
   {$endif}

So it works for both and I can happily use the type ByteString for 
storing uncoded 8 bit entities.

To me here the Term "ANSI" is extremely ugly, but it can be confined to 
a few lines on the top :) .

I do suppose that this will work in Lazarus as well (at least when 
adding some more ifdefs).

-Michael




More information about the Lazarus mailing list