Dim i As Integer
   Dim j As Integer
   Dim d As String
   i = 3
   j = 4
   d = "34"
   MsgBox Str(i) + Str(j)
   MsgBox d
   'MsgBox FileList(2)
   If 0 = StrComp(Str(i) + Str(j), Str(d)) Then
   MsgBox "success"
   End If
不会弹出success,   MsgBox Str(i) + Str(j)弹出的是3 4,MsgBox d弹出的是34,
应该怎样连接才能让两者等价呢

解决方案 »

  1.   

    If -1= StrComp(Str(i) + Str(j), Str(d)) Then
      

  2.   

    使用str函数是前面有空格的,应当把str改成cstr
      

  3.   

    Private Sub Form_Load()    Dim i As Integer
        Dim j As Integer
        Dim d As String
        Dim a As String    i = 3
        j = 4
        d = "34"
        a = CStr(i & j)
        MsgBox a
        MsgBox d
        'MsgBox FileList(2)
        If 0 = StrComp(a, d) Then
            MsgBox "success"
        End IfEnd Sub