石
石光亮
Unregistered / Unconfirmed
GUEST, unregistred user!
我想在一个TForm2 单元中加入一个TProcessPanel数组属性,实现如下:
private
function GetOperation(const AIndex:Integer):TProcessPanel;
procedure SetOperation(Value:TProcessPanel;const AIndex:Integer);
public
property Operation[const AIndex:Integer]:TProcessPanel read GetOperation write SetOperation;
function TForm2.GetOperation(const AIndex:Integer):TProcessPanel;
begin
if (AIndex<0) or (AIndex>20) then
raise Exception.Create('wrong planet number')
else
Result:=Operation[AIndex];
end;
procedure TForm2.SetOperation(Value:TProcessPanel;Const AIndex:Integer);
begin
if (AIndex<0) or (AIndex>20) then
raise Exception.Create('wrong planet number')
else
Operation[AIndex].assign(Value);
end;
运行时出现imcompaptible types 是何原因?
private
function GetOperation(const AIndex:Integer):TProcessPanel;
procedure SetOperation(Value:TProcessPanel;const AIndex:Integer);
public
property Operation[const AIndex:Integer]:TProcessPanel read GetOperation write SetOperation;
function TForm2.GetOperation(const AIndex:Integer):TProcessPanel;
begin
if (AIndex<0) or (AIndex>20) then
raise Exception.Create('wrong planet number')
else
Result:=Operation[AIndex];
end;
procedure TForm2.SetOperation(Value:TProcessPanel;Const AIndex:Integer);
begin
if (AIndex<0) or (AIndex>20) then
raise Exception.Create('wrong planet number')
else
Operation[AIndex].assign(Value);
end;
运行时出现imcompaptible types 是何原因?