module - what is this
-
I've come across some sample code and at the top of the code, after the imports and before the class declaration, it says module BLAH. What is a module. I've never seen this before. Thanks Tom
Tom Wright tawright915@gmail.com
-
I've come across some sample code and at the top of the code, after the imports and before the class declaration, it says module BLAH. What is a module. I've never seen this before. Thanks Tom
Tom Wright tawright915@gmail.com
MSDN says: A Module statement defines a reference type available throughout its namespace. A module (sometimes called a standard module) is similar to a class but with some important distinctions. Every module has exactly one instance and does not need to be created or assigned to a variable. Modules do not support inheritance or implement interfaces. Notice that a module is not a type in the sense that a class or structure is — you cannot declare a programming element to have the data type of a module. You can use Module only at namespace level. This means the declaration context for a module must be a source file or namespace, and cannot be a class, structure, module, interface, procedure, or block. You cannot nest a module within another module, or within any type. For more information, see Declaration Contexts and Default Access Levels. A module has the same lifetime as your program. Because its members are all Shared, they also have lifetimes equal to that of the program. Modules default to Friend (Visual Basic) access. You can adjust their access levels with the access modifiers. For more information, see Access Levels in Visual Basic. All members of a module are implicitly Shared. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
-
MSDN says: A Module statement defines a reference type available throughout its namespace. A module (sometimes called a standard module) is similar to a class but with some important distinctions. Every module has exactly one instance and does not need to be created or assigned to a variable. Modules do not support inheritance or implement interfaces. Notice that a module is not a type in the sense that a class or structure is — you cannot declare a programming element to have the data type of a module. You can use Module only at namespace level. This means the declaration context for a module must be a source file or namespace, and cannot be a class, structure, module, interface, procedure, or block. You cannot nest a module within another module, or within any type. For more information, see Declaration Contexts and Default Access Levels. A module has the same lifetime as your program. Because its members are all Shared, they also have lifetimes equal to that of the program. Modules default to Friend (Visual Basic) access. You can adjust their access levels with the access modifiers. For more information, see Access Levels in Visual Basic. All members of a module are implicitly Shared. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
So do I access the subs and functions of a module as if they were in my code? I do not need to declare it or instantiate it? Tom
Tom Wright tawright915@gmail.com
-
So do I access the subs and functions of a module as if they were in my code? I do not need to declare it or instantiate it? Tom
Tom Wright tawright915@gmail.com
Hi, I suggest you try it. And look it up on MSDN. Or read a book on VB.NET In fact the combination of these is the best way to make real progress. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google