[Lazarus] Does Lazarus support a complete Unicode Component Library?

Sven Barth pascaldragon at googlemail.com
Tue Feb 15 16:38:11 CET 2011


Am 14.02.2011 15:23, schrieb Graeme Geldenhuys:
> Not that I care (because Delphi doesn't do everything perfect), but how
> does Delphi 2010 handle such alias types - especially when passed as
> parameters (var and const)?

In Delphi such strings with codepage need to be defined with "type" and 
thus they are different types (not compatible regarding "var").

The following example fails to compile at the call of Test.

====source begin====
program strvartest;

{$APPTYPE CONSOLE}

uses
   SysUtils;

type
   CyrillicString = type AnsiString(1251);
   LatinString = type AnsiString(1252);

procedure Test(var aStr: CyrillicString);
begin

end;

var
   s: LatinString;
begin
   s := 'Foo';
   Test(s);
end.
====source end====

Regards,
Sven




More information about the Lazarus mailing list