エラーが発生するこの単純なプログラムがあります。コードは次のとおりです。
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
fullname、address、citystatezip をメッセージボックスに入力しようとすると、アドレスを整数に変換できないというエラーが表示され続けます。これら 3 つの変数すべてを文字列として宣言し、プログラムを実行したときに、これら 3 つのテキスト ボックスに AB と C を入力しました。