Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2003-10

Override Default Value of Property

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Judison

Hi all,

It's posibile to override the default value of a property???

for example:

  TClassA = class
  privare
    FInt: Integer;
  published
    property Int: Integer read FInt write FInt default 0;
  end;
  TClassB = class(TClassA)
  published
    property Int default 5;
  end;

when writing out a TClassA object, the property Int will only be writed if "Int 0", the same to a TClassB object, that should (?) write only if "Int 5"....

property Int default 5; compiles but has no effect, it's a bug????

PS: I know that I can do it with "stored"... but I think that to override property's default value should work... PPS: I'm using fpc 1.0.10 with -S2

TIA
Judison

Reply by email

darekM
to Judison

In the new version of SYSTEM.PP there is a declared variable THandle I think there isn't necessary to duplicate declarations in other units like

CLASSES :  classesh.inc  ---> move THandle to section with TPoint
SYSUTILS : posix\sysutils.pp ---> change to
type
  THandle = type system.thandle;

Darek

Reply by email

Florian Klaempfl
to darekM
darekM wrote 7 lines
In the new version of SYSTEM.PP there is a declared variable THandle I think there isn't necessary to duplicate declarations in other units like CLASSES : classesh.inc ---> move THandle to section with TPoint SYSUTILS : posix\sysutils.pp ---> change to type THandle = type system.thandle;

Fixed, thx.

Reply by email

darekM
to Florian Klaempfl

I've tried to recompile COMPILATOR

I think I've found bugs:
in FPC.PP
line 67 string --> shortstring
procedure findexe(var ppcbin:shortstring);

in PPUDUMP.PP
line 235 string --> shortstring
function hexstr(val : cardinal;cnt : byte) : shortstring; line 227 string --> shortstring
function HexB(b:byte):shortstring;

I don't know where compilere change strings, but I think that will be better

all with today CVS

darek

PS. I can't recompile RTL - I've got
varianth.inc(157,53) Error: Identifier not found "olevariant"

Reply by email

Peter Vreman
to darekM
you wrote 22 lines
I've tried to recompile COMPILATOR I think I've found bugs: in FPC.PP line 67 string --> shortstring procedure findexe(var ppcbin:shortstring); in PPUDUMP.PP line 235 string --> shortstring function hexstr(val : cardinal;cnt : byte) : shortstring; line 227 string --> shortstring function HexB(b:byte):shortstring; I don't know where compilere change strings, but I think that will be better all with today CVS darek PS. I can't recompile RTL - I've got varianth.inc(157,53) Error: Identifier not found "olevariant"

You have to rebuild everything using make cycle and start with a 1.0.10 compiler

Peter

Reply by email