Home All Groups Group Topic Archive Search About

Namespace Question ...

Author
2 Mar 2006 7:03 PM
Joe HM
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?

Thanks!
Joe

Author
2 Mar 2006 7:28 PM
Aboulfazl Hadi
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
Author
2 Mar 2006 8:01 PM
Armin Zingler
Show quote Hide quote
"Joe HM" <unixve***@yahoo.com> schrieb
> 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?


If the members are shared, you can import them like namespaces.


Armin
Author
2 Mar 2006 8:33 PM
Armin Zingler
"Armin Zingler" <az.nospam@freenet.de> schrieb
> If the members are shared, you can import them like namespaces.


"them" = the classes (not the members)


Armin
Author
3 Mar 2006 11:51 AM
Joe HM
Thanks ... I'll give that a try!

Joe