Private Sub Command1_Click()Dim S() As String
Dim SS() As String
Dim MyTxt As String
Dim k As IntegerSS = Split(txt1CRC.Text, " ")
For k = 0 To UBound(SS)
S(UBound(S) + 1 + k) = SS(k)
NextS = Split(txtSend.Text, " ")
For k = 0 To UBound(S)
MyTxt = MyTxt & S(k) & " "
Next
msgbox MyTxt
把SS数组的数据放入S数组的最后,系统提示下标越界,是怎么回事啊, 还有其他一些办法吗?

解决方案 »

  1.   

    Private Sub Command1_Click()
    Dim S
    Dim SS
    Dim k As Integer
    txtSend.Text = "ff eyl 35f dgg jh"
    S = Split(txtSend.Text, " ")
    txt1CRC.Text = "Qer ty u13f yyi"
    SS = Split(txt1CRC.Text, " ")
    For k = 0 To UBound(SS)
    j = UBound(S) + 1 + k
    ReDim Preserve S(j)
    S(j) = SS(k)
    Next
    For k = 0 To UBound(S)
    MsgBox S(k)NextEnd Sub
      

  2.   


    Private Sub Command1_Click()Dim S() As String
    Dim SS() As String
    Dim MyTxt As String
    Dim k As IntegerS = Split(txtSend.Text, " ")
    SS = Split(txt1CRC.Text, " ")
    For k = 0 To UBound(SS)
    ReDim Preserve S(UBound(S) + 1)
    S(UBound(S)) = SS(k)
    NextFor k = 0 To UBound(S)
    MyTxt = MyTxt & S(k) & " "
    Next
    msgbox MyTxt
    试试
      

  3.   

    For k = 0 To UBound(SS) - 1