跟书上学的做的一个"个人所得税"的小东西
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
sum,para,tax:single;
begin
sum:=strtofloat(edit1.Text);
sum:=sum-800;
tax:=0;
if sum>2000
then begin
para:=sum-2000;
sum:=sum-para;
tax:=tax+para*0.15;
end;
if sum>500
then begin
para:=sum-500;
sum:=sum-para;
tax:=tax+para*0.1;
end;
if sum>0
then tax:=tax+sum*0.05;
edit2.text:=floattostr(tax);
end;
那个代码检测没有出现红色行的错误提示,但是点运行不出现完成的那个东西,下面错误提示是
[Error] Unit1.pas(123): Declaration expected but end of file found
[Fatal Error] Project1.dpr(5): Could not compile used unit '作业6\Unit1.pas'