又是类型不匹配的问题
程序代码
temp = Split(Text1.Text, "vbCrLf")
For i = 0 To UBound(temp)
inf104(i) = temp(i) + 1
Print inf104(i)
Next i
Text1.Text是单行的时候没有问题
Text1.Text是多行的时候
在inf104(i) = temp(i) + 1 那行老出问题
[解决办法]
Private Sub Command1_Click() Dim temp() As String Dim inf104() As Integer Dim i As Integer temp = Split(Text1.Text, vbCrLf) ReDim inf104(UBound(temp)) For i = 0 To UBound(temp) inf104(i) = Val(temp(i)) + 1 Print inf104(i) Next iEnd Sub