2009-09-10 32 views

回答

7

是的,您可以在项目选项中打开“允许全局”选项。然后你可以做下面的代码:

interface 

method GlobalMethod: Integer; public; 

implementation 

这是不建议使用这种结构。更多.Net的方式是在类上使用静态/类方法。

type 
    TSomeClass = public class 
    public 
    class method GlobalMethod: Integer; 
    end; 

// Call like this 
I := TSomeClass.GlobalMethod; 
相关问题