R
Rex the Strange
Hello all,
Traditionally I'm a Delphi and VB6 programmer and have recently started
working with VB.NET (which, I might add, I love, but that's beside the
point). Anyway, I was trying to make a catch-all library of routines
which I use commonly (I have one in Delphi and I was porting some of
the routines to VB.NET).
I was delighted to find out about modules - I love that a language
doesn't tie you to making everything an object - in my opinion oop is
good, but it isn't the be-all-to-end-all of programming as some people
might have you believe: not everything in programming (or the world for
that matter) is an object. Some things are processes. Ideal programming
is a combination of the two.
But I digress.
Anyway, I thought I'd make a class library - I called it stdlib (which
is the name I always use: short for "standard library") and inside it I
put two modules: constants and procedures.
Here's the oddity. When I include them into a new file, using the
Imports statement, I find that I type:
Imports stdlib.
And when I hit the dot (.) a popup dropdown list appears showing me all
of the elements contained in stdlib. Fair enough, but I see "constants"
which I can then specify and I see "procedures" which I can specify but
I also see all of the constants defined in "constants" and all of the
procedures defined in "procedures."
What's even more weird is that although I can see these in the list if
I just define
Imports stdlib
with no qualifier and try to use those constants and procedures I get
unknown element errors when attempting to compile. Why even show them
if I can't use them at that level? What other options do I have? I
could make a static class except that that could promote stupidity in
attempting to make instances of that class. I've tried defining a
namespace which has the effect I want except that I can only put types
in them, no constants or subroutines.
Any thoughts?
Traditionally I'm a Delphi and VB6 programmer and have recently started
working with VB.NET (which, I might add, I love, but that's beside the
point). Anyway, I was trying to make a catch-all library of routines
which I use commonly (I have one in Delphi and I was porting some of
the routines to VB.NET).
I was delighted to find out about modules - I love that a language
doesn't tie you to making everything an object - in my opinion oop is
good, but it isn't the be-all-to-end-all of programming as some people
might have you believe: not everything in programming (or the world for
that matter) is an object. Some things are processes. Ideal programming
is a combination of the two.
But I digress.
Anyway, I thought I'd make a class library - I called it stdlib (which
is the name I always use: short for "standard library") and inside it I
put two modules: constants and procedures.
Here's the oddity. When I include them into a new file, using the
Imports statement, I find that I type:
Imports stdlib.
And when I hit the dot (.) a popup dropdown list appears showing me all
of the elements contained in stdlib. Fair enough, but I see "constants"
which I can then specify and I see "procedures" which I can specify but
I also see all of the constants defined in "constants" and all of the
procedures defined in "procedures."
What's even more weird is that although I can see these in the list if
I just define
Imports stdlib
with no qualifier and try to use those constants and procedures I get
unknown element errors when attempting to compile. Why even show them
if I can't use them at that level? What other options do I have? I
could make a static class except that that could promote stupidity in
attempting to make instances of that class. I've tried defining a
namespace which has the effect I want except that I can only put types
in them, no constants or subroutines.
Any thoughts?