Q(VB5) : Different between module & class module 
Author Message
 Q(VB5) : Different between module & class module

what is the different between module & class module? what is the limitation
and function of them?
Can some1 tell me?
Thanx in advance.



Sun, 23 Apr 2000 03:00:00 GMT  
 Q(VB5) : Different between module & class module

 modules are for code usable in the program proper while class modules
contains fuctions for use by instances of the class only.


Quote:
>what is the different between module & class module? what is the limitation
>and function of them?
>Can some1 tell me?
>Thanx in advance.



Thu, 27 Apr 2000 03:00:00 GMT  
 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.



Thu, 27 Apr 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Class Modules & Modules

2. Class Module & Module

3. Class modules 97 - Refering to array within a custom class module

4. Accessing procedures of a class module from another class module

5. Circular Reference Between Modules when 2 Class Modules Listen to Each others Events

6. Class Module and Module

7. VB Modules/Class Modules

8. class module vs. module

9. modules and class modules

10. Returning the name of a module/class module

11. Modules or Class modules?

12. Q: Code Module vs UserControl (Form, Class) module.

 

 
Powered by phpBB® Forum Software