 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
kosstr12 Master Cheater
Reputation: -1
Joined: 12 Jul 2008 Posts: 339
|
Posted: Thu Jan 01, 2009 8:13 pm Post subject: VB 6 Calculator help |
|
|
Hey, I'm kind of new to VB, and I'm trying to figure out how to work the math. My program is supposed to let the user input to numbers, and then post the sum of them. Instead, it is just putting the numbers together(4+5=45). Here's my code, I hope someone can help me:
| Code: |
Private Sub Command1_Click()
Dim firstint As String
firstint = Text1.Text
Dim secondint As String
secondint = Text2.Text
Text3.Text = firstint + secondint
End Sub
|
|
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Thu Jan 01, 2009 8:25 pm Post subject: Re: VB 6 Calculator help |
|
|
| kosstr12 wrote: | Hey, I'm kind of new to VB, and I'm trying to figure out how to work the math. My program is supposed to let the user input to numbers, and then post the sum of them. Instead, it is just putting the numbers together(4+5=45). Here's my code, I hope someone can help me:
| Code: |
Private Sub Command1_Click()
Dim firstint As String
firstint = Text1.Text
Dim secondint As String
secondint = Text2.Text
Text3.Text = firstint + secondint
End Sub
|
|
Convert the strings to integers, then add them, and convert the result back to a string. _________________
|
|
| Back to top |
|
 |
kosstr12 Master Cheater
Reputation: -1
Joined: 12 Jul 2008 Posts: 339
|
Posted: Thu Jan 01, 2009 8:31 pm Post subject: Re: VB 6 Calculator help |
|
|
| samuri25404 wrote: | | kosstr12 wrote: | Hey, I'm kind of new to VB, and I'm trying to figure out how to work the math. My program is supposed to let the user input to numbers, and then post the sum of them. Instead, it is just putting the numbers together(4+5=45). Here's my code, I hope someone can help me:
| Code: |
Private Sub Command1_Click()
Dim firstint As String
firstint = Text1.Text
Dim secondint As String
secondint = Text2.Text
Text3.Text = firstint + secondint
End Sub
|
|
Convert the strings to integers, then add them, and convert the result back to a string. |
Thanks! It worked  |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|