主题:Delphi调试紧急求助
各位高手可不可以班我看看这个Delphi代码,编的是一个学生选课系统。
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, Grids, DBGrids, DB, DBTables, ComCtrls, StdCtrls;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
N1: TMenuItem;
NA11Students: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
NAStudent: TMenuItem;
NA11Courses: TMenuItem;
NACourse: TMenuItem;
NAddCourse: TMenuItem;
NDelCourse: TMenuItem;
NA11CS: TMenuItem;
NDoCS: TMenuItem;
NUnDoCS: TMenuItem;
NCbyS: TMenuItem;
NSbyC: TMenuItem;
NDelStudent: TMenuItem;
NAddStudent: TMenuItem;
Label1: TLabel;
StatusBar1: TStatusBar;
StatusBar2: TStatusBar;
Table_S: TTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
Table_C: TTable;
QueryC_S: TQuery;
TableC_S: TTable;
procedure NA11StudentsClick(Sender: TObject);
procedure NAStudentClick(Sender: TObject);
procedure NAddStudentClick(Sender: TObject);
procedure NDelStudentClick(Sender: TObject);
procedure NA11CoursesClick(Sender: TObject);
procedure NACourseClick(Sender: TObject);
procedure NAddCourseClick(Sender: TObject);
procedure NDelCourseClick(Sender: TObject);
procedure NA11CSClick(Sender: TObject);
procedure NDoCSClick(Sender: TObject);
procedure NUnDoCSClick(Sender: TObject);
procedure NCbySClick(Sender: TObject);
procedure NSbyCClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
TForm2 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure FormShow(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.FormShow(Sender: TObject);
begin
Edit1.Clear;
Edit2.Clear;
Edit1.SetFocus;
end;
procedure TForm2.BitBtn1Click(Sender: TObject);
begin
if Edit1.Text='' then
begin
showmessage(''''+Label2.Caption+'''不能为空!');
Form2.ModalResult:=mrCancel;
end
else
if Edit2.Text='' then
begin
showmessage(''''+Label3.Caption+'''不能为空!');
Form2.ModalResult:=mrCancel;
end;
end;
我是菜菜鸟级人物。程序全完是案中案课本一步步搬上来的,可是编译后出现 [Error] Unit2.pas(86): Declaration expected but end of file found [Fatal Error] Unit1.pas(60): Could not compile used unit 'Unit2.pas'
麻烦告知下哪里出现了错误。调试不通过!!紧急,马上就要交作业了
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, Grids, DBGrids, DB, DBTables, ComCtrls, StdCtrls;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
N1: TMenuItem;
NA11Students: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
NAStudent: TMenuItem;
NA11Courses: TMenuItem;
NACourse: TMenuItem;
NAddCourse: TMenuItem;
NDelCourse: TMenuItem;
NA11CS: TMenuItem;
NDoCS: TMenuItem;
NUnDoCS: TMenuItem;
NCbyS: TMenuItem;
NSbyC: TMenuItem;
NDelStudent: TMenuItem;
NAddStudent: TMenuItem;
Label1: TLabel;
StatusBar1: TStatusBar;
StatusBar2: TStatusBar;
Table_S: TTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
Table_C: TTable;
QueryC_S: TQuery;
TableC_S: TTable;
procedure NA11StudentsClick(Sender: TObject);
procedure NAStudentClick(Sender: TObject);
procedure NAddStudentClick(Sender: TObject);
procedure NDelStudentClick(Sender: TObject);
procedure NA11CoursesClick(Sender: TObject);
procedure NACourseClick(Sender: TObject);
procedure NAddCourseClick(Sender: TObject);
procedure NDelCourseClick(Sender: TObject);
procedure NA11CSClick(Sender: TObject);
procedure NDoCSClick(Sender: TObject);
procedure NUnDoCSClick(Sender: TObject);
procedure NCbySClick(Sender: TObject);
procedure NSbyCClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
TForm2 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure FormShow(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.FormShow(Sender: TObject);
begin
Edit1.Clear;
Edit2.Clear;
Edit1.SetFocus;
end;
procedure TForm2.BitBtn1Click(Sender: TObject);
begin
if Edit1.Text='' then
begin
showmessage(''''+Label2.Caption+'''不能为空!');
Form2.ModalResult:=mrCancel;
end
else
if Edit2.Text='' then
begin
showmessage(''''+Label3.Caption+'''不能为空!');
Form2.ModalResult:=mrCancel;
end;
end;
我是菜菜鸟级人物。程序全完是案中案课本一步步搬上来的,可是编译后出现 [Error] Unit2.pas(86): Declaration expected but end of file found [Fatal Error] Unit1.pas(60): Could not compile used unit 'Unit2.pas'
麻烦告知下哪里出现了错误。调试不通过!!紧急,马上就要交作业了