|
-
Aug 10th, 2000, 01:44 PM
#1
Thread Starter
Member
Why would it be illegal to use AddressOf in a Class?
-
Aug 10th, 2000, 01:59 PM
#2
transcendental analytic
I'm not sure but it wouldn't work, if you have several objects running, how can you address one or them (which one?) And what if you don't have any objects of that class at all?
It just only works with modules since they are there until your app is terminated
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 10th, 2000, 04:59 PM
#3
you can only use the AddressOf Operator on Public Functions that you write yourself, that are contained in a class module.
for example you couldnt use it on an API call, or a private function, or anything inside a form(like Command1_Click)
-
Aug 10th, 2000, 05:47 PM
#4
Frenzied Member
also you have to use AddressOf as a Parameter in a function. for example this
Code:
Dim lngAddress as Interger
Private Sub Form_Load()
lngAddress = AddressOf MyFunction
End Sub
wuld be illegal but this
Code:
Private Sub Form_Load()
lngAddress = GetValue(AddressOf MyFunction)
End Sub
Private Function GetValue(Value as Long)
GetValue = Value
End Function
is fine.
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
|
Click Here to Expand Forum to Full Width
|