What is the different between declare a function in "Module" and "Class" ?
Printable View
What is the different between declare a function in "Module" and "Class" ?
john,
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.
IE:
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
--
~~~
C'Ya,
mrfelis
mrfelis@yahoo.NOSPAM.com
just remove the spam
john <john99@yahoo.com> wrote in message news:3959ebe3@news.devx.com...
>
> What is the different between declare a function in "Module" and "Class" ?