interface 单 uses Windows, Messages, SysUtils, Classes 元 Graphics, Controls, Forms, Dialogs Stdctrls type
interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type 单 元
T ype Tdays-(mon, tue, wed, thu, fri, sat, sun) TForml= class(tForm) 单 Button TButton procedure Buttonl Click( Sender: TObject) 元 private i Private declarations j public i Public declarations I end Temp -class( tobject) 自定义对象 name: string[ 10] Integer function total integer end
Type Tdays=(mon,tue,wed,thu,fri,sat,sun); TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; Temp =class(tobject) 自定义对象 name: string[10]; sal: integer; function total : integer; end; 单 元
窗体对象 单 对象与记录相似之处是都包含数据域, 完但对象还包括方法,即操作对象数据的 方法。 在 Delphi中编写的所有事件处理程序都 是窗体对象的方法。 可以在 Public和 private中添加新的数据域 和方法
窗体对象 • 对象与记录相似之处是都包含数据域, 但对象还包括方法,即操作对象数据的 方法。 • 在 Delphi 中编写的所有事件处理程序都 是窗体对象的方法。 • 可以在Public和private中添加新的数据域 和方法。 单 元
var Forml TForml 单 emp: Temp key: Boolean 元
var Form1: TForm1; emp:Temp; key : Boolean ; 单 元
interface{所定义的内容,可为其他项目利用} 单 uses <引用单元列表 type var 元 Function verify(sno: integer; sname: string): boolean lmplementatlon
interface {所定义的内容,可为其他项目利用} uses <引用单元列表> type var Function verify(sno:integer;sname:string):boolean; implementation 单 元