Collection of the common code is known as module, modules are separate files from projects and can be reused. There are basically like general section of a from, but in a different file. Such files can contain global variables and general procedures; however may not contain event procedures, as modules aren’t tied to any particular form.

Programmer may which to make a module that contains common functions. That is way to programmer writes the code once and can use it for any project to use any one of particular functions without writing the code again. Functions in the module are not object specific. This in the long run saves a lot of time. Below is an example of object-specific and non object-specific code:

Object-Specific Code

Public Function Copy Text ()

Clipboard.SetText = frmMain.txtText.SetText

End Function

Non Object-Specific Code:

Public Function Copy Text (Text Source)

Clipboard.SetText = TextSource

End Function


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s