none
还是那个二位数组的问题 RRS feed

  • 问题

  • http://social.microsoft.com/Forums/zh-CN/vbasiczhchs/thread/6e70f44c-9d62-4b5b-a78f-2bbaeda99f41
    '上面的地址是原贴
    '以下是我根据feiyun0112版主指导写的通用过程,并在VB6中通过,但转换为ASP代码时出错,请帮助解决:

    Private Sub Sort(a)'此过程在VB6中调用通过
    'Dim s(3) As String
    Dim s() As String
    d = UBound(a, 1): t = UBound(a, 2)
    ReDim s(t)
    Dim i As Integer, j As Integer
    For i = 0 To d
        For j = 0 To t
            s(i) = s(i) & Format(a(i, j), "0000000000.00")
        Next
        s(i) = s(i) & Format(i, "0000000000.00")
    Next
    For i = 0 To d
        For j = i + 1 To t
            If s(i) < s(j) Then
                Dim tmp As String
                tmp = s(j)
                s(j) = s(i)
                s(i) = tmp
            End If
        Next
    Next
    For i = 0 To d
        j = Right(s(i), 10)
       For b = 0 To t
         Print a(j, b) & "      ";
       Next
    Print
    Next
    End Sub
    '下面是转换为ASP过程:
    Sub Sort(a)
    Dim s()
    d = UBound(a, 1)
    t = UBound(a, 2)
    ReDim s(d)
    Dim i,j
    For i = 0 To d
        For j = 0 To t
            s(i) = s(i) & Format(a(i, j), "0000000000.00")'在这一句出错,提示为下面的注释部分
         'Microsoft VBScript 运行时错误 (0x800A000D)
         '类型不匹配: 'format'
        Next
        s(i) = s(i) & Format(i, "0000000000.00")
    Next
     
    For i = 0 To d
        For j = i + 1 To t
            If s(i) < s(j) Then
                Dim tmp
                tmp = s(j)
                s(j) = s(i)
                s(i) = tmp
            End If
        Next
    Next
    End Sub
    2009年3月14日 6:29

答案