Newbie module?

  • Thread starter Thread starter Paul Fredlein
  • Start date Start date
P

Paul Fredlein

Hi,

Just starting with VB .net, I can understand and get going with classes but
what is a module, why would I use it and what's it for? Can't I do
everything just using classes?

Thanks,

Paul
 
Hi Paul,

You can do everything just using classes.
The module is an old part of VB6.
Although some here use it as a kind of startup section in the same way they
did it with VB6.

(I don't use them)

I hope this helps a little bit?

Cor
 
in addition

you can also use them to declare your global variables, in this way they are
independant from forms you have to load
 
Paul Fredlein said:
Just starting with VB .net, I can understand and get going with
classes but what is a module, why would I use it and what's it for?
Can't I do everything just using classes?

In addition to Cor's reply:
Modules do "not really" exist in the .NET world. Actually modules are
classes and the members are implicitly declared as Shared. Also, modules are
automatically imported at the project level - same as adding the module name
to the import list in the project properties.
 
Hi Eric,

In addition

For that you can also use classes with shared properties. Those are nicer to
manage and even to make standard.

:-))

Cor
 
* "Paul Fredlein said:
Just starting with VB .net, I can understand and get going with classes but
what is a module, why would I use it and what's it for? Can't I do
everything just using classes?

You don't need modules, nevertheless, they are sometimes a nice thing.
Modules are like classes with shared members, so you can access the
members from everywhere.
 
Modules should be avoided really. In this OO environment an object should
contain everything it needs to operate.

Once upon a time, you might have seen global variables defined in a module
as well as subroutines , functions etc. Once should no longer operate in
this way.

OO - Keep the faith, but only when it makes sense !?!

Regards - OHM


Paul said:
Hi,

Just starting with VB .net, I can understand and get going with
classes but what is a module, why would I use it and what's it for?
Can't I do everything just using classes?

Thanks,

Paul

Best Regards - OHMBest Regards - OHM (e-mail address removed)
 
Back
Top