-
different between Module & Class?
What is the different between declare a function in "Module" and "Class" ?
-
Re: different between Module & 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" ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|