delphi7编程的问题
//mainForm文件unitMainForm;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Grap...
//mainForm文件
unit MainForm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,
untClassTeacher in 'untClassTeacher.pas',
untClassStudent in 'untClassStudent.pas';
type
TForm1 = class(TForm)
lbTeacher: TListBox;
lbStudent: TListBox;
btnTeacher: TButton;
btnStudent: TButton;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
ATeacher:TTeacher;
AStudent:TStudent;
implementation
{$R *.dfm}
end.
//学生单元
unit untClassStudent;
interface
uses
controls;
type
TStudent=class
Name:String;
Sex:Boolean;
Birthday:TDate;
function Talk:string;
end;
implementation
{ TStudent }
function TStudent.Talk: string;
begin
Result:='I"m learning programming';
end;
end.
//老师单元
unit untClassTeacher;
interface
uses
controls;
type
TTeacher=class
Name:string;
Sex:Boolean;
Birthday:TDate;
TeachPost:string;
function Talk:string;
end;
implementation
{ TTeacher }
function TTeacher.Talk: string;
begin
Result:='I"m a teacher';
end;
end.
//主程序
program Exa03_02;
uses
Forms,Controls,
MainForm in 'MainForm.pas' {Form1},
untClassTeacher in 'untClassTeacher.pas',
untClassStudent in 'untClassStudent.pas';
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
以下是编译信息,我是自学delphi的,这个程序弄了一个晚上弄不懂,跪求高手指点迷津啊,小僧不甚感激!
[Error] MainForm.pas(8): ',' or ';' expected but 'IN' found
[Fatal Error] MainForm.pas(9): Could not compile used unit 'untClassStudent.pas' 展开
unit MainForm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,
untClassTeacher in 'untClassTeacher.pas',
untClassStudent in 'untClassStudent.pas';
type
TForm1 = class(TForm)
lbTeacher: TListBox;
lbStudent: TListBox;
btnTeacher: TButton;
btnStudent: TButton;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
ATeacher:TTeacher;
AStudent:TStudent;
implementation
{$R *.dfm}
end.
//学生单元
unit untClassStudent;
interface
uses
controls;
type
TStudent=class
Name:String;
Sex:Boolean;
Birthday:TDate;
function Talk:string;
end;
implementation
{ TStudent }
function TStudent.Talk: string;
begin
Result:='I"m learning programming';
end;
end.
//老师单元
unit untClassTeacher;
interface
uses
controls;
type
TTeacher=class
Name:string;
Sex:Boolean;
Birthday:TDate;
TeachPost:string;
function Talk:string;
end;
implementation
{ TTeacher }
function TTeacher.Talk: string;
begin
Result:='I"m a teacher';
end;
end.
//主程序
program Exa03_02;
uses
Forms,Controls,
MainForm in 'MainForm.pas' {Form1},
untClassTeacher in 'untClassTeacher.pas',
untClassStudent in 'untClassStudent.pas';
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
以下是编译信息,我是自学delphi的,这个程序弄了一个晚上弄不懂,跪求高手指点迷津啊,小僧不甚感激!
[Error] MainForm.pas(8): ',' or ';' expected but 'IN' found
[Fatal Error] MainForm.pas(9): Could not compile used unit 'untClassStudent.pas' 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询