954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to use module

I would like to know how to use module, why we need to use module and when to use module. I've tried to use module but some of my textboxes, labels and other controls didn't recognize by the module i've created.

Attachments module.png 11.66KB
khentz
Junior Poster in Training
57 posts since Aug 2011
Reputation Points: 10
Solved Threads: 2
 

You need to read books for all that.

Read this and this .

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

Module normally contain methods that are project wide available.
So lets say you have this module:

Module Helper

Public function Blubb(byval x as integer, byval y as integer) as integer
     Return x + y
End function

End Module


You then can use this function in your forms like

txtTest.Text= Helper.Blubb(12, 7)


Module are also holding any extensions that you define in your projects.

GeekByChoiCe
Master Poster
721 posts since Jun 2009
Reputation Points: 208
Solved Threads: 168
 

Usually Module should contain the method or functions which can be used in all the forms of projects. Example: Error handler code, database connections etc..

Pgmer
Master Poster
714 posts since Apr 2008
Reputation Points: 54
Solved Threads: 121
 

Hi Khentz

As already explained Modules are used to keep procedures (Functions) which is used throughout the entire solution ...

For example...Transformation matrix, Rotation matrix etc.. Here is a typical example

Public Class ObjectHolder
Dim A as list (of Mycurves)
Private sub CurveInitialize

End Sub

Private sub CurveTransformAxial

End Sub

Private sub CurveRotate

End Sub

End class

Public class MyCurves
 Private L as list (of Lines)

End class

Public class MyLines
 Private P as list (of Points)
  
  Public sub New()'---
'----Calls for the general initalization procedure from the module

End sub
End class

Public Class MyPoints
 Private StartPoint as system.drawing.point
 Private EndPoint as system.drawing.point

End class


Now u have a set of curves in 2D drawing area...All curves are made of small lines of length dx & all lines has two points ....
For the initialization of these curves associated with a set of general procedure like transformation matrix to be expressed in cartesian coordinate system etc...it depends
Also if the curve has to be rotated around an axis each objects defined has to call for the general rotation matrix procedure...
So we keep these set of procedures in a module

Module Matrices
Public function TransformationMatrix(Byref TemL as MyLines)


End Function

Public function RotationMatrix(Byref TemL as MyLines)


End Function
End Module

Most of the CAD software uses same kind of structure


Rgrds

Sam

samson_zed
Newbie Poster
24 posts since Sep 2007
Reputation Points: 13
Solved Threads: 6
 

Hope this might provide some light on the matter as well.

codeorder
Posting Virtuoso
1,915 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: