Global methods?

483 views Asked by At

This MSDN page mentions global methods in a module.

Module.GetMethods "returns the global methods defined on the module."

I wasn't aware there were global methods. The only thing I can think of is that this only applies to languages that allow global methods, i.e. C++, but that this doesn't not apply to C#.

What are these "global methods" that this MSDN page is talking about?

2

There are 2 answers

2
richard On BEST ANSWER

Ok I should have continued reading the book ...

For assemblies originally written in languages that support the notion of modules (for example, Visual Basic), the Module class also supports GetField, GetFields, GetMethod, and GetMethods methods. In those types of modules, fields and methods can be attached directly to a module.

1
Naveed Butt On

This is the comment I placed earlier:

I am not sure, but I think the MSDN link you've given is referring to the Modules that are created under VB.Net and global methods are created under those modules

As mentioned in comments, here is the way, how you would create modules in VB.Net and create global functions under those modules...

http://www.homeandlearn.co.uk/net/nets9p7.html

OR

http://www.mka-soft.com/vbnet-tutorial/25-vbnet-tutorial-16-module