为什么constructor调试不了?
我建了一个BPUnit文件,里面定义了一个TBP类:
unit BPUnit;
interface
uses
SysUtils, SinSampleUnit;
type
.......
TBP = class(TObject)
private
......
protected
constructor Create;
procedure UnitaryYValue; //make the Y value unitary
public
......
end;//end class definiation
implementation
constructor TBP.Create;
begin
UnitaryYValue; //在这里设置断点
end;
procedure TBP.UnitaryYValue; //Unitar the Y value
var
I: Integer;
YDistance: double;
begin
......
end;
end.
然后在另外一个FormUnit中创建一个TBP类的对象:
unit BPFormUnit;
interface
uses
......, BPUnit;
type
TBPForm = class(TForm)
......
var
BPForm: TBPForm;
implementation
.......
procedure TBPForm.FormCreate(Sender: TObject);
var
BP: TBP;
begin
BP := TBP.Create;//在这里设置断点2
end;
end.
在上述地方设置断点2时,发现进不去BPUnit调试,这是什么原因?
设置断点1时,发现程序根本没有运行到constructor TBP.Create;里面,这是怎么回事呢?