Re: Command Line Compilation - Inherits

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Todd A (zeus_at_olympus.com)
Date: 03/03/04


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



Relevant Pages

  • Re: Command Line Compilation - Inherits
    ... > xyz.dll fails on compilation when code in xyz is referencing code in abc. ... Members of a module are accessible within a namespace without specifying ... Remember that even when compiling assemblies that contain VB.NET ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: [9fans] Man pages for add-ons
    ... One day it just clicked, and I think it was well worth learning, but compiling stuff isn't in the same class, it's a means to an end and more of a chore. ... Indeed, and a limit which varies from person to person, hence why I'm fighting namespace growth. ... When you can query to find which package a file comes from, then query on the package name to find the docs, config files, executables, anything you want by filename and then some, that's quite a help with organising. ...
    (comp.os.plan9)
  • Re: Trying to learn c++, need help compiling
    ... I even dug out my copy ... I'm not sure exactly namespace was introduced in c++, ... The namespace thing is freqently the cause of problems while compiling ... messages regarding unknown function calls. ...
    (alt.os.linux.suse)
  • RE: Bug with namespaces in XSD.EXE /dataset (C#)
    ... VS IDE throw the error message ... "'DataTime' doesn't exist in 'MyCompany.DataSystem' namespace" when ... compiling. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: modular programming in Forth
    ... private defns of a single module have different versions? ... may not be a change that a source using the public interface alone has ... All available in the same namespace? ... I see the dual wordlists of a named ...
    (comp.lang.forth)