我有这个简单的程序给我一个错误。代码如下
Private Sub btnProcess_Click(sender As Object, e As EventArgs) Handles btnProcess.Click
Dim FullName As String = ""
Dim Address As String = ""
Dim CityStateZip As String = ""
Dim Stoves As Integer
Dim Refrigerators As Integer
Dim Dishwashers As Integer
INPUT_DATA(FullName, Address, CityStateZip, Stoves, Refrigerators, Dishwashers)
MsgBox(FullName, Address, CityStateZip)
End Sub
Sub INPUT_DATA(ByRef Name As String, ByRef Address As String, ByRef CSZ As String, ByRef Stoves As Integer, ByRef Refrigerators As Integer, ByRef Dishwashers As Integer)
If txtName.Text = "" Then
Name = InputBox("Please enter a name!")
Else
Name = txtName.Text
End If
If txtAddress.Text = "" Then
Address = InputBox("Please enter an address!")
Else
Address = txtAddress.Text
End If
If txtCSZ.Text = "" Then
CSZ = InputBox("Please enter City, State, Zip!")
Else
CSZ = txtCSZ.Text
End If
End Sub
当我尝试使用消息框全名、地址和 citystatezip 时,它一直给我一个错误,说它无法将地址转换为整数。我将所有这三个变量都声明为字符串,并在运行程序时在这三个文本框中输入 AB 和 C。