Geht es hier um float-properties? Der bug ist bekannt seit Delphi 1, wurde angemahnt, und kam zurück mit "as designed". Ray Lischner hat eine Lösung gefunden, ich poste hier mal den Teil einer Komponente für Delphi 1, der die Lösung beinhaltet und erklärt. Falls das nicht das Problem ist, nevermind.
Delphi-Quellcode:
...
protected
procedure ReadD2WorldXw(Reader: TReader);
procedure WriteD2WorldXW(Writer: TWriter);
procedure DefineProperties(Filer: TFiler);
override;
published
property D2WorldXW: extended
read xwd2
write setxwd2
stored false;
{Don't worry about the stored false in all of these. They get stored:
see override of DefineProperties. The default storing process never
writes a value 0 of a float property to the dfm-file and the default
value set in the constructor is used instead. So if that default is
<>0, a value 0 can never be set. Overriding DefineProperties fixes it
(workaround by Ray Lischner).
Stored false is used, so the property is not stored twice. (Thanks to
Joe Herb for the tip)}
...
procedure TMathImage.ReadD2WorldXW(Reader: TReader);
begin
xwd2 := Reader.ReadFloat;
end;
procedure TMathImage.WriteD2WorldXW(Writer:TWriter);
begin
Writer.WriteFloat(xwd2);
end;
procedure TMathImage.DefineProperties(Filer: TFiler);
begin
inherited DefineProperties(Filer);
with Filer
do
begin
DefineProperty('
D2WorldXW', ReadD2WorldXW, WriteD2WorldXW, true);
end;
end;