答案:用class关键字
比如你要建立一个学生类:
type
Tstudent = class
name : string[10];
sex : char[2];
procedure dosomething;
function MyFun:int;
private
num : integer;
public
procedure dosomething2;
end;
建好了类一般要创建对象才能用,你这样创建
var
student : Tstudent;
begin
student := Tstudent.Create;
end;
这样一个学生类的实例student就创建出来了,就可以用它的上面定义的属性跟方法了
上一个:求delphi中,程序界面嵌入网页的办法,网上有很多办法,试了不行。
下一个:Delphi中PChar和TString如何转换