关于delphi语句的理解?

来源:百度知道 编辑:UC知道 时间:2024/06/08 06:26:27
class procedure Error(const Msg: string; Data: Integer); overload;
class procedure Error(Msg: PResStringRec; Data: Integer); overload;
类中有这样的函数语句是什么意思? 为什么前面要加上一个class呢?

类函数\类过程.
它们是直接操作在类上面(没有实例化的对象)
下面是Delphi Help 的描述

A class method is a method (other than a constructor) that operates on classes instead of objects. The definition of a class method must begin with the reserved word
class. For example,

type
TFigure = class
public
class function Supports(Operation: string): Boolean; virtual;
class procedure GetInfo(var Info: TFigureInfo); virtual;
...
end;

The defining declaration of a class method must also begin with class. For example,

class procedure TFigure.GetInfo(var Info: TFigureInfo);
begin
...
end;

In the defining declaration of a class method,