0
질문이 모호하거나 혼란 스러울 경우 사과드립니다. Delphi Prism .NET 용입니다.기본 클래스 내에서 변수에 대해 런타임 알 수없는 식별자 오류가 발생하는 이유는 무엇입니까?
변수 유형이 인 기본 클래스가 있습니다. 범위는 직사각형 유형입니다. 이 클래스에서 다른 클래스는 파생되거나 상속되며 기본 클래스 변수 경계에 액세스 할 수 있습니다. 디자인 타임 동안 컴파일러는 기본 클래스의 경계 변수를 인식하지만 디버그 시간 동안 기본 클래스의 변수 경계에 대해 알 수없는 오류가 발생합니다. 따라서 프로그램이 성공적으로 컴파일되지만 올바르게 실행되지 않습니다.
: 여기TGateControl = class(TControlObject)
fInputCount:SmallInt;
private
protected
public
constructor (theForm:Form);
end;
기본 클래스 변수를 도출 클래스의 생성자이다
여기
TControlObject = public class
bounds:Rectangle; <<=========This is the Variable in question
private
protected
public
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;
내가 뭘 잘못하고 있니? 감사합니다.
내가 액세스 지정자 아래에 없으면 기본적으로 공개라고 생각했습니다. 델파이 win32 플랫폼에서 작동하는 방법입니다. 오늘 나는 새로운 것을 배웠습니다. 감사. – ThN