【发布时间】:2009-09-10 05:26:09
【问题描述】:
【问题讨论】:
标签: delphi-prism oxygene
【问题讨论】:
标签: delphi-prism oxygene
是的,如果您在项目选项中打开“允许全局变量”选项,则可以。然后你可以做以下代码:
interface
method GlobalMethod: Integer; public;
implementation
不建议使用这种结构。一种更 .Net 的方式是在类上使用静态/类方法。
type
TSomeClass = public class
public
class method GlobalMethod: Integer;
end;
// Call like this
I := TSomeClass.GlobalMethod;
【讨论】: