|
-
Sep 2nd, 2000, 04:41 PM
#11
Monday Morning Lunatic
I expect it will do one of two things:
1. Refuse to compile
2. Choose depending on whether you assign the return value:
Code:
Public Sub ViciousRoutine(Arg1 As String, Arg2 As Long)
'Some code...
End Sub
Public Function ViciousRoutine(Arg1 As String, Arg2 As Long) As Long
'Some OTHER code...
End Function
Public Sub Test()
Dim x as Long
x = ViciousRoutine("Hi", 50)
ViciousRoutine "Different", 100
End Sub
In this case, when you assigned it to x, it would use the Function. When you ignored the return value, it uses the Sub instead.
Dennis - in multithreading, you can do cool things like this:
You have a program that (say) creates a fractal image. You want to make it simple, so you have your second thread, which draws the picture. What the main thread does, is start the second, then wait for the user to hit escape. If they do, it then stops the second thread.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
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
|