L
liuchong
Unregistered / Unconfirmed
GUEST, unregistred user!
type
TMyDate=class
private
FDate:Byte;
procedure SetDate(ADate:Byte);
public
property Date:Byte read FDate write SetDate default 12;
end;
{ TMyDate }
procedure TMyDate.SetDate(ADate: Byte);
begin
if ADate in [1..31] then
Self.FDate:=ADate;
end;
为什么default值没有保存下来啊?
procedure TForm1.btn1Click(Sender: TObject);
var
C1:TMyDate;
begin
C1:=TMyDate.Create;
try
//C1.Date:=10;
Caption:=IntToStr(C1.Date);
finally
FreeAndNil(C1);
end;
TMyDate=class
private
FDate:Byte;
procedure SetDate(ADate:Byte);
public
property Date:Byte read FDate write SetDate default 12;
end;
{ TMyDate }
procedure TMyDate.SetDate(ADate: Byte);
begin
if ADate in [1..31] then
Self.FDate:=ADate;
end;
为什么default值没有保存下来啊?
procedure TForm1.btn1Click(Sender: TObject);
var
C1:TMyDate;
begin
C1:=TMyDate.Create;
try
//C1.Date:=10;
Caption:=IntToStr(C1.Date);
finally
FreeAndNil(C1);
end;