Re: Command Line Compilation - Inherits
From: Todd A (zeus_at_olympus.com)
Date: 03/03/04
- Next message: Lloyd Sheen: "Please help with tutorial or sample"
- Previous message: Teemu Keiski: "Re: dropdownlist initial value"
- In reply to: mikeb: "Re: Command Line Compilation - Inherits"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 3 Mar 2004 10:48:56 -0600
Thanks again Mike,
After tinkering a bit with what you suggested, I found that my module wasn't
declared Public. If you don't stipulate either Public or Private, the
module will default to Private. This was causing the problem.
That was the last piece to my puzzle. Thanks again.
-Todd
"mikeb" <mailbox.google@mailnull.com> wrote in message
news:OegOa8JAEHA.688@tk2msftngp13.phx.gbl...
> Todd A wrote:
>
> > Thanks Mike,
> > That did the trick.
> >
> > I've been away from technology for awhile, so this response is late.
> >
> > Here's one more question if you have time:
> >
> > What about vb files that are just MODULES and not classes?
> > Example: abc.dll is an assembly that has nothing but a public module in
it.
> > xyz.dll fails on compilation when code in xyz is referencing code in
abc.
> > Even though I include the reference to abc.dll when I try to compile
> > xyz.dll, it fails. Is there something special I should know about
> > compileing modules and referencing them?
> >
>
> I'm not a VB.NET expert, but as far as I know, VB.NET Modules are simply
> a way to provide something like global variables and non-class-based
> functions.
>
> Members of a module are accessible within a namespace without specifying
> the name of the module - you would still have to import the namespace
> containing the module (or specify the namespace explicitly).
>
> So if you have a something like:
>
> namespace NS1
> public module ModuleX
> sub test( s as string)
> Console.WriteLine( "Inside NS1.ModuleX.test")
> end sub
> end module
> end namespace
>
> The test() subroutine can be called using any of the following:
>
> NS1.test( "x")
> NS1.ModuleX.test( "x")
> test("x") ' only if there's an "imports NS1" statement
>
> Remember that even when compiling assemblies that contain VB.NET
> Modules, the Module might be a member of a namespace by virtue of a
> compiler option - just like when compiling a class.
>
> Personally, I think that the namespace a type resides in should be
> specified in the source code and that it is a mistake for the VB.NET
> compiler to have that option. But it does, and your build environment
> needs to take it into account.
>
> --
> mikeb
- Next message: Lloyd Sheen: "Please help with tutorial or sample"
- Previous message: Teemu Keiski: "Re: dropdownlist initial value"
- In reply to: mikeb: "Re: Command Line Compilation - Inherits"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|