版权声明: 本文由Lyris完成,首发于CSDN,作者保留中文版权。 |
type
TDemo = class
aa: string;
bb: string;
end;
使用的时候
with TDemo.Create do
try
aa := 'test';
bb := aa; //set 方法和get方法缺省都有了
finally
Free;
end;
关键是类的代码简洁,对于只有类似结构体的只有property的类, 这样写尤其方便 :)
版权声明: 本文由Lyris完成,首发于CSDN,作者保留中文版权。 |
type
TDemo = class
aa: string;
bb: string;
end;
使用的时候
with TDemo.Create do
try
aa := 'test';
bb := aa; //set 方法和get方法缺省都有了
finally
Free;
end;
关键是类的代码简洁,对于只有类似结构体的只有property的类, 这样写尤其方便 :)