DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: different between Module & Class?

  1. #1
    john Guest

    different between Module & Class?

    What is the different between declare a function in "Module" and "Class" ?

  2. #2
    mrfelis Guest

    Re: different between Module & Class?


    A class is an extension of the User Defined Type, just as a class is an
    extension of the struct in C++.

    A public function in a module can be called from anywhere in a program
    without specifing the module name first.
    Accessing a public function in a class requires declaring and creating a
    variable of that class before hand.


    in modSupport:
    Public Function ALong() as Long
    ALong = 1
    End Function

    in clsLocal:
    Public Function BLong() as long
    BLong = 2
    End Function

    in frmTest:
    Private Form_Click()
    Dim oClass as clsLocal

    Print ALong()
    Set oCLass = New clsLocal
    Print oCLass.BLong()
    Set oClass = Nothing
    End Sub

    just remove the spam
    john <> wrote in message
    > What is the different between declare a function in "Module" and "Class" ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center