我这段代码没有问题 我将Do改为了Do1,不然不能通过,我想可能是与系统的基本函数重名. 然后将RHALT1Fields去掉了。 Option ExplicitPublic Type ISARecord seqno As Integer item As String vendor As String fromdate As Date todate As Date End Type Private ISA1() As ISARecord Public Sub do1() Dim n As Long Dim ISATemp As ISARecord While n < 100 ReDim Preserve ISA1(n + 1) ISATemp.seqno = 0 ' Trim(("SEQNO")) ISATemp.item = Trim(("ITEMID")) ISATemp.vendor = ("VENDORID") ISATemp.fromdate = 0 '("STARTDATE") ISATemp.todate = 0 '("ENDDATE") ISA1(n) = ISATemp n = n + 1 Wend
If n > 1 Then QuickSort1 ISA1(), LBound(ISA1), UBound(ISA1) - 1 End IfEnd SubPrivate Sub QuickSort1(ByRef isa() As ISARecord, ByVal L As Long, ByVal U As Long) MsgBox L & U End Sub
还是QuickSort1 ISA1(), LBound(ISA1), UBound(ISA1) - 1时出错
QuickSort1是什么?
compile error
我将Do改为了Do1,不然不能通过,我想可能是与系统的基本函数重名.
然后将RHALT1Fields去掉了。
Option ExplicitPublic Type ISARecord
seqno As Integer
item As String
vendor As String
fromdate As Date
todate As Date
End Type
Private ISA1() As ISARecord
Public Sub do1()
Dim n As Long
Dim ISATemp As ISARecord
While n < 100
ReDim Preserve ISA1(n + 1)
ISATemp.seqno = 0 ' Trim(("SEQNO"))
ISATemp.item = Trim(("ITEMID"))
ISATemp.vendor = ("VENDORID")
ISATemp.fromdate = 0 '("STARTDATE")
ISATemp.todate = 0 '("ENDDATE")
ISA1(n) = ISATemp
n = n + 1
Wend
If n > 1 Then
QuickSort1 ISA1(), LBound(ISA1), UBound(ISA1) - 1
End IfEnd SubPrivate Sub QuickSort1(ByRef isa() As ISARecord, ByVal L As Long, ByVal U As Long)
MsgBox L & U
End Sub
是你的代码有问题,仔细查找一下吧
可能是你的quicsord的入口参数问题