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

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to