Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Module question... 1

Status
Not open for further replies.

MarQ

Technical User
Dec 5, 2001
44
PH
Hi, i just would like to ask regarding a command that is put into a module..i assume that this is suppose to be a "ready" to use command, meaning, once i call this command like "Save".. it will be used easily just by calling. So if this is the case, does it mean that once the program is executed, automatically it is running? if yes, will it consume memory? considering that there are a lot of commands in a module, does this mean it will eat a lot of memory? My next question is, how do i stop it from executing after using it so that it will not keep on eating memory. Just curious since i have been thinking if it is better to put commands in module then call them or put it in the object directly.. Thanks you and more power!
 
it will be used easily just by calling.
{YES}
So if this is the case, does it mean that once the program is executed, automatically it is running?
{Loaded, yes, not running until called}
if yes, will it consume memory?
{You-Flippin-Betcha!}
considering that there are a lot of commands in a module, does this mean it will eat a lot of memory?
{You just met Software-Bloat! (basically, yes)}
My next question is, how do i stop it from executing after using it so that it will not keep on eating memory.
{You can't! *See below}
Just curious since i have been thinking if it is better to put commands in module then call them or put it in the object directly.. Thanks you and more power!

Module Vs Form
You're using roughly the amount of memory. (basically) However, If you have three forms, they can all call a single function from the module, saving memory.

Module Vs Class Module:

OK, You're modules are loaded up app launch. Class Modules, however, are "templates" for the object they describe. So you could, for instance...

Set MyObject as New Object1Class
'Create an object, and using up RAM
MyObject.SubThis ' And CPU cycles...
Y = MyObject.Function ("Hello", "World")
Set myObject = Nothing ' Object unloads from memory now
Msgbox Y

Not exactly a comprehensive explaination, but I hope it helps clear up what I think you just want confirmation of.
 
thanks for the tip..i really appreciate it..anyway, sorry for the delay in response, there was power outage here for 3 days..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top