[fpc-devel] Found two Delphi incompatibilities

Micha Nelissen micha at neli.hopto.org
Thu Aug 31 10:41:16 CEST 2006


Sergei Gorelkin wrote:
> const
>   TestData: array[0..7] of Char = 'abc'#10'def'#0;
> 
> procedure Test1;
> var
>   sl: TStringList;
> begin
>   sl := TStringList.Create;
>   sl.Text := string(@TestData[0]);  // <- fails here
>   sl.Free;
> end;

A typecast is a typecast. Simply remove the typecast, and it should work ?

> Sample 2: This one compiles with Delphi (again, it inserts necessary
> conversion Wide -> Ansi), but does not compile with FPC, neither in
> objfpc nor in Delphi mode.

The (should be) conversion code seems to be missing.

Micha



More information about the fpc-devel mailing list