VB初心者質問スレ Part4
レス数が900を超えています。1000を超えると表示できなくなるよ。
0924900
NGNGDim oNewCollection As Collection
Dim oPlayer As clsPlayer
Dim n As Long
Dim isInserted As Boolean
Set oNewCollection = New Collection
For Each oPlayer In m_oCollection
isInserted = False
For n = 1 To oNewCollection.Count
If (oPlayer.nLeague < oNewCollection.Item(n).nLeague) Then
Call oNewCollection.Add(oPlayer, , n)
isInserted = True
Exit For
End If
Next
If (isInserted = False) Then
Call oNewCollection.Add(oPlayer)
End If
Next
Set m_oCollection = oNewCollection
End Sub
Public Sub SortByBattingAverage()
Dim oNewCollection As Collection
Dim oPlayer As clsPlayer
Dim n As Long
Dim isInserted As Boolean
Set oNewCollection = New Collection
For Each oPlayer In m_oCollection
isInserted = False
For n = 1 To oNewCollection.Count
If (oPlayer.nBattingAverage < oNewCollection.Item(n).nBattingAverage) Then
Call oNewCollection.Add(oPlayer, , n)
isInserted = True
Exit For
End If
Next
If (isInserted = False) Then
Call oNewCollection.Add(oPlayer)
End If
Next
Set m_oCollection = oNewCollection
End Sub
レス数が900を超えています。1000を超えると表示できなくなるよ。