T
tea_nine
Unregistered / Unconfirmed
GUEST, unregistred user!
以下代码,RUN时提示“Could not create outfile ‘.../Main.dcu'”。
请问是哪里出错。
unit Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TfrmFunction = class(TForm)
lblHint: TLabel;
edtX: TEdit;
lblY: TLabel;
btnCalc: TButton;
procedure btnCalcClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmFunction: TfrmFunction;
var x:integer ;
implementation
{$R *.dfm}
procedure TfrmFunction.btnCalcClick(Sender: TObject);
begin
x:=StrToInt(edtX.Text);
if x=0 then lblY.Caption:='Y的值为:0'
else if x>0 then lblY.Caption:='Y的值为:1'
else lblY.Caption:='Y的值为:-1';
end;
end.
请问是哪里出错。
unit Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TfrmFunction = class(TForm)
lblHint: TLabel;
edtX: TEdit;
lblY: TLabel;
btnCalc: TButton;
procedure btnCalcClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmFunction: TfrmFunction;
var x:integer ;
implementation
{$R *.dfm}
procedure TfrmFunction.btnCalcClick(Sender: TObject);
begin
x:=StrToInt(edtX.Text);
if x=0 then lblY.Caption:='Y的值为:0'
else if x>0 then lblY.Caption:='Y的值为:1'
else lblY.Caption:='Y的值为:-1';
end;
end.