命令 |
说明 |
program |
程序 |
uses |
引用单元 |
unit |
单元 |
interface |
声明区域 |
implementation |
实现区域 |
initialization |
初始化区域 |
finalization |
销毁区域 |
type |
类声明 |
var |
变量声明 |
class |
类/类方法(类方法调用时不需要创建对象) |
private |
私有的 |
public |
公有的 |
published |
公有的可产生类型信息 |
Protected |
受保护的 |
Procedure |
方法(过程)没返回值 |
function |
函数有返回值 |
constructor |
构造方法 |
destructor |
析构方法 |
property |
属性 |
overload |
函数重载 |
override |
重写(覆盖) |
virtual |
虚方法(VMT)速度快占用空间大 |
dynamic |
动态方法(DMT)节约空间速度慢 |
abstract |
抽象方法(前提是虚函数或动态函数) |
implements |
委托实现 |
interface |
接口 |
//新单元----------------------------------------------
unit Unit1; //新单元
interface //声明区域
type
d = interface // d 是个接口 接口只有public 不用写
['{A9B35374-9417-496A-B5D5-4D75B2553BF9}'] //ctrl+shift+G自动生成
Procedure dd1(); //接口空方法,不能实现 类继承接口必须实现全部方法
Procedure tiao(); //(十五)委托实现
end;
d1 = interface(d) //口也可以继承接口,单继承
Procedure dd2(); //接口空方法,