如果问题看起来含糊不清或令人困惑,我深表歉意。这适用于 Delphi Prism .NET。
我有一个基类,其中有一个名为矩形边界的变量。另一个类从这个类派生或继承并有权访问基类变量边界。在设计期间,编译器从基类中识别边界变量,但在调试期间,它不断为基类中的变量边界引发未知错误。因此,我的程序编译成功但无法正确运行。
这是基类和变量:
TControlObject = public class
bounds:Rectangle; <<=========This is the Variable in question
private
protected
public
end;
这是派生类:
TGateControl = class(TControlObject)
fInputCount:SmallInt;
private
protected
public
constructor (theForm:Form);
end;
这是带有基类变量的派生类的构造函数:
constructor TGateControl(theForm:Form);
begin
inherited constructor(theForm);
fInputCount := 2;
bounds.width := bounds.Right-(bounds.left+(4 * CGridSize)); <<=======Here is where unknown identifier error is raised for bounds variable.
bounds.Height := bounds.Bottom-(bounds.top+(3 * CGridSize));<<=======Here is where unknown identifier error is raised for bounds variable.
end;
我究竟做错了什么?谢谢,