
Q(VB5) : Different between module & class module
A code mudule can contain Sub and Function routines that are callable
from other places in your program. A code module would be a good
place to put a function that needs to be called from every form in
your app, for instance.
A class module is used to write the properties and methods of a class.
If you're not familiar with object-oriented programming, this is tough
to understand. A 'car' class, for instance, would have properties
such as :
NumDoors
Color
BodyStyle
InteriorColor
etc...
and methods such as
Start
Accellerate
Turn
Stop
ShiftGears
etc...
Then, you could make instances of your Car object:
set Mercedes = New Car
set Pinto = New Car
You now have two instances of your Car object, each with its own set
of (independent) properties.
If this sounds a lot like what you see in the controls on your forms,
you're right. Controls are instances of classes. (As are forms
themselves.)
Pick up a good book on object oriented programming. Master the
learning curve. It's worth it.
-Matt
Quote:
>what is the different between module & class module? what is the limitation
>and function of them?
>Can some1 tell me?
>Thanx in advance.