[fpc-devel]Delphi incompatibity
Pavel V. Ozerski
pavel at insect.mail.iephb.ru
Tue Mar 13 12:52:02 CET 2001
Hello,
There are new new problems with properties which I found by porting KOL:
1) if property has index, it cannot access to class fields by reading/writing, unlike Delphi.
Sample which can be compiled by Delphi but not by FPC:
{$APPTYPE CONSOLE}
{$IFDEF FPC}
{$MODE DELPHI}
{$ENDIF}
type
aClass=class
private
aa:longint;
procedure bb(index:integer;value:longint);
public
property cc:longint index 1 read aa write bb;
end;
procedure AClass.bb(index:integer;value:longint);
begin
aa:=value;
end;
var
C:aClass;
begin
C:=aClass.Create;
C.cc:=1;
writeln(C.cc);
end.
To use it with FPC, I must write a method - function with dummy index parameter! It is a solution but it is not good!
2) index in properties in FPC cannot be outside of LONGINT range (even if it is inside CARDINAL range);
property AAA:longint index $FFFFFFFF read ... is good for Delphi but causes error message in FPC.
Pavel
More information about the fpc-devel
mailing list