4

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?

richard
  • 12,263
  • 23
  • 95
  • 151
  • 1
    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. – Naveed Butt Jun 22 '11 at 06:19
  • @Naveed Butt: I think you're right. Can you point me to some information on that subject? I don't work in VB.NET but would like to understand how this works . . . – richard Jun 22 '11 at 06:20
  • answer added below. Please mark it as answer, if you think I was the first one to suggest this... – Naveed Butt Jun 22 '11 at 06:36

2 Answers2

3

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

CodesInChaos
  • 106,488
  • 23
  • 218
  • 262
Naveed Butt
  • 2,861
  • 6
  • 32
  • 55
2

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.

richard
  • 12,263
  • 23
  • 95
  • 151