Structure 类型排序
'类型定义
Public Structure RingRecord
Dim recordTime As DateTime
Dim footSteps As String
Dim sportMinutes As String
Dim distance As String
Dim calorie As String
End Structure
’写比较子
Private Shared Function sortRingRecord(ByVal xRingRecord As RingRecord, ByVal yRingRecord As RingRecord) As Integer
If (xRingRecord.recordTime > yRingRecord.recordTime) Then
Return -1
ElseIf xRingRecord.recordTime = yRingRecord.recordTime Then
Return 0
Else
Return 1
End If
End Function
'排序
Dim lstRingRecord As List(Of RingRecord)
'赋值lstRingRecord
lstRingRecord.Sort(AddressOf sortRingRecord)
三板设计->叠合板深化图绘制
欢迎关注微信公众账号ByCAD