delphi初始化问题
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;constGenlength=30;Genwidth=80;type TForm1 = class(TForm) Button1: TButton; function CanTerminate(GenPoint:Tpoint;genLength,genWidth:Real):boolean; procedure Button1Click(Sender: TObject); Function ToPoint(GenPointFrom:TPoint;Genlength,Genwidth:Real;Isleft:Boolean):TPoint; private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}function Tform1.CanTerminate(GenPoint:Tpoint;GenLength,GenWidth:Real):boolean;beginif (GenPoint.x<0) or (GenPoint.x>Self.ClientWidth)or (GenPoint.y<0) or (GenPoint.y>self.ClientHeight)or(GenLength<1) thenResult:=trueelseresult:=False;end;Function Tform1.ToPoint(GenPointFrom:TPoint;Genlength,Genwidth:Real;Isleft:Boolean):TPoint;beginif Isleft thenbeginResult.x:=GenPointFrom.x+200;Result.y:=GenPointFrom.y+200;end;end;procedure TForm1.Button1Click(Sender: TObject);varGenPointto,GenPointFrom:TPoint; Genlength,Genwidth:Real;beginif CanTerminate(GenPointFrom,GenLength,GenWidth) thenbeginsystem.Exit;endelsebeginself.Canvas.Pen.Color:=clred;self.canvas.MoveTo(GenPointFrom.x,GenPointFrom.y);self.canvas.LineTo(GenPointto.x,GenPointto.y);showmessage(✀GenPointFrom.x,GenPointFrom.y✀);end;end;end.错误 genlength、genwidth没有初始化 我不是很明白