|
-
Jun 12th, 2002, 12:39 PM
#1
Thread Starter
Addicted Member
Understanding Multithreading
Ok, I got the basic concept down:
Sub LoopThread()
'Code for Thread
End Sub
Sub Main()
Dim myThread As Thread
myThread = New Thread(AddressOf LoopThread)
myThread.Start()
End Sub
What I want to know is if you can pass the LoopThread any variables? I seem to get an error message whenever I try:
Sub LoopThread(ByVal x As Short)
'Code
end Sub
I get a blue line under LoopThread on the following line:
myThread = New Thread(AddressOf LoopThread)
Something about the wrong signature...
This didn't work either:
myThread = New Thread(AddressOf LoopThread(x))
Is the only way to pass it a variable by using a global? I hope not.
-Daryl
"Two More Rolls of Duct tape, and the world is mine!"
VB.NET Guru
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
|