|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Namespace Question ...I have a set of utilities that are structured as follows ... Namespace Utility Public Module Main Public TestA as cTestBase Public TestB as cDummyBase End Module End Namespace A VB file that uses them calls Imports Utility and then TestA.functionIncTestBase() TestB.functionIncDummyBase() to call a function within. What I was wondering is if there is any way to create some sort of namespace like Namespace Utility.TestA Namespace Utility.TestB so that I do not need to specify the "TestA." all the time. I know that I would use "With Test" but I have about ten instances of classes for which I would like to do that and I don't think I can nest With statements? Thanks! Joe Hi Joe
Namespaces are a logical grouping of classes. If you want to call a method of the class, you must create an instance of the class and call the method by the instance name (not Shared Member ). So it's impossible to igone instance name and calling only Class Members. Thanks, A.Hadi
Show quote
Hide quote
"Joe HM" <unixve***@yahoo.com> schrieb If the members are shared, you can import them like namespaces.> Hello - > > I have a set of utilities that are structured as follows ... > > Namespace Utility > Public Module Main > Public TestA as cTestBase > Public TestB as cDummyBase > End Module > End Namespace > > A VB file that uses them calls > Imports Utility > and then > TestA.functionIncTestBase() > TestB.functionIncDummyBase() > to call a function within. > > What I was wondering is if there is any way to create some sort of > namespace like > Namespace Utility.TestA > Namespace Utility.TestB > so that I do not need to specify the "TestA." all the time. > > I know that I would use "With Test" but I have about ten instances > of classes for which I would like to do that and I don't think I can > nest With statements? Armin "Armin Zingler" <az.nospam@freenet.de> schrieb "them" = the classes (not the members)> If the members are shared, you can import them like namespaces. Armin |
|||||||||||||||||||||||