📄 testproperties.out
字号:
unit testproperties;
interface
uses types;
type
tfoo = class(TObject)
private
fibar, fibaz, fiwibble, fifish, fiquux: integer;
function getarray(piindex: integer): integer;
procedure setarray(piindex: integer; pivalue: integer);
function getconstarray(const piindex: integer): integer;
procedure setconstarray(const piindex: integer; pivalue: integer);
function getcomplexarrayprop(const piindex: integer; var pcstring: string): boolean;
public
property arrayval[piindex: integer]: integer Read getarray Write setarray; default;
property constarrayval[const piindex: integer]: integer
Read getconstarray Write setconstarray;
property complexarrayprop[const piindex: integer;var pcsstring: string]: boolean
Read getcomplexarrayprop;
published
property bar: integer Read fibar Write fibar;
property baz: integer index 3 Read fibaz Write fibaz;
property wibble: integer Read fiwibble Write fiwibble stored False;
property fish: integer index 5 Read fifish Write fifish default 6;
property quux: integer index 5 Read fiquux Write fiquux nodefault;
end;
type
tbar = class(TObject)
function getarray(piindex: integer): integer;
procedure setarray(piindex: integer; pivalue: integer);
public
property arrayval[piindex: integer]: integer Read getarray Write setarray; default;
end;
type
thasapoint = class(TObject)
private
fpoint: tpoint;
public
property x: integer Read fpoint.x;
property y: integer Read fpoint.y Write fpoint.y;
end;
implementation
function tfoo.getarray(piindex: integer): integer;
begin
Result := piindex * 3;
end;
function tfoo.getcomplexarrayprop(const piindex: integer; var pcstring: string): boolean;
begin
Result := False;
pcstring := pcstring + 'aa';
end;
function tfoo.getconstarray(const piindex: integer): integer;
begin
Result := piindex * 3;
end;
procedure tfoo.setarray(piindex, pivalue: integer);
begin
end;
procedure tfoo.setconstarray(const piindex: integer; pivalue: integer);
begin
end;
function tbar.getarray(piindex: integer): integer;
begin
Result := piindex * 4;
end;
procedure tbar.setarray(piindex, pivalue: integer);
begin
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -