开发者

Call global function from within Delphi class's method

Is it possible to call global methods from within a class where they are obscured by member functions of the same name?

I know in C++ you have the following sy开发者_C百科ntax:

int var = 0;

void temp() {
    int var = 2;
    ::var = var;
} //Global var is set to 2


Yes you can by using the name of the unit instead of ::

Like:

unit1.var := 2;

See for more details: http://delphi.about.com/od/beginners/l/aa060899.htm


You can try

UnitName.VarName := 2
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜