You are viewing our Forum Archives. To view or take place in current topics click here.
VB.Net Programming Help
Posted:

VB.Net Programming HelpPosted:

bradanter96
  • Ladder Climber
Status: Offline
Joined: Dec 05, 201013Year Member
Posts: 368
Reputation Power: 15
Status: Offline
Joined: Dec 05, 201013Year Member
Posts: 368
Reputation Power: 15
I need to write a program where you use threads to add two numbers. I have no idea what I am doing, so help would be much appreciated. This is what I have so far:

Module Worker
Public t1 As New System.Threading.Thread(AddressOf Sum)
Public t2 As New System.Threading.Thread(AddressOf SumOfTwo)
Sub Sum()
Console.WriteLine("Sum of two numbers")
For index As Integer = 1 To 15
If index Mod 2 = 0 Then
Console.WriteLine(index)
t1.Sleep(2)
End If
Next
End Sub

End Module
#2. Posted:
GGR
  • TTG Senior
Status: Offline
Joined: Apr 25, 201113Year Member
Posts: 1,295
Reputation Power: 55
Status: Offline
Joined: Apr 25, 201113Year Member
Posts: 1,295
Reputation Power: 55
Have you copied this code or have you done it yourself. Also can you give a little more info about your project
#3. Posted:
Diablo_Botter
  • New Member
Status: Offline
Joined: Oct 27, 201211Year Member
Posts: 10
Reputation Power: 0
Status: Offline
Joined: Oct 27, 201211Year Member
Posts: 10
Reputation Power: 0
bradanter96 wrote I need to write a program where you use threads to add two numbers. I have no idea what I am doing, so help would be much appreciated. This is what I have so far:

Module Worker
Public t1 As New System.Threading.Thread(AddressOf Sum)
Public t2 As New System.Threading.Thread(AddressOf SumOfTwo)
Sub Sum()
Console.WriteLine("Sum of two numbers")
For index As Integer = 1 To 15
If index Mod 2 = 0 Then
Console.WriteLine(index)
t1.Sleep(2)
End If
Next
End Sub

End Module
You should really use the Microsoft VB express.
#4. Posted:
zazmodz
  • V5 Launch
Status: Offline
Joined: Nov 11, 201211Year Member
Posts: 74
Reputation Power: 4
Status: Offline
Joined: Nov 11, 201211Year Member
Posts: 74
Reputation Power: 4
That code is not right at all and as the guy above said, use vb.net express as it would make it simpler
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.