Entry
What's the difference between modules and class modules?
Mar 13th, 2004 14:38
Washington Corrêa, Maggie Chao,
With class modules you can create instances and with modules you can't.
Example:
Dim k as new classmodule
k.variable = 3
dim j as new classmodule
j.variable = 5
module.variable = 6
debug.print k.variable
debug.print j.variable
debug.print module.variable
Both "k" and "j" are "objects" (instances of a class), and both have a
variable named "variable". This variable will have different values in
"k" and "j". In the case of a module you'll be allowed to change only
*one* variable (not different copies of it).