2009-09-10 83 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;