当前位置:主页>仓库管理软件> 列表

class function name:type 中的cl 找免费超市管理软件

进销存软件版1楼: 我在system.pas中发现有类似这样的函数定义
class function name:type
请问是什么意思???

2楼: 类方法 如免费超市管理软件

3楼: 类

4楼: 这是一个类函数,可以不用实例化该类而直接使用。

5楼: lcj 可以讲得清楚一点吗??我是初学者!

6楼: 即可以直接把它当作一个普通的函数引用。

进销存软件版7楼: unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

TMyClass = class(TObject)
public
class procedure f_ShowMessage;
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

{ TMyClass }

class procedure TMyClass.f_ShowMessage;
begin
ShowMessage(''Hello Word!'');
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
TMyClass.f_ShowMessage;
end;

end.

8楼: 自定义的公共类函数吧.

9楼: 类方法,不创建对象就可调用该方法