Im making a calculator Program to start off on visual basic. I got it to work with MsgBox, but now I'm trying to get it to work with the Print.
MsgBox Example
Public Class Form1
Private Sub Button1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseClick
Dim Pizza As Integer
Dim Taco As Integer
Dim Cheese As String
Dim Cat As String
Pizza = InputBox("Please Enter the first number")
Taco = InputBox("Please Enter the second number")
Cheese = (Pizza + Taco)
Cat = ("youranswer is " + Cheese)
MsgBox(Cat)
End Sub
End Class
Print Example
Public Class Form1
Private Sub Button1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseClick
Dim Pizza As Integer
Dim Taco As Integer
Dim Cheese As String
Dim Cat As String
Pizza = InputBox("Please Enter the first number")
Taco = InputBox("Please Enter the second number")
Cheese = (Pizza + Taco)
Cat = ("youranswer is " + Cheese)
Print(Cat)
End Sub
End Class
Say I type in 6 and 6 I'm geting erros saying Example:
Conversion from string "youranswer is 12" to type 'Integer' is not valid.
Ive tried many things, but it's not working. I want to know what I need to do to get it to print out how I want it. Do I need to do some conversions properly somehow?