<% Class CardArray Private cardCount Private cards() Private Sub Class_Initialize() cardCount = 0 End Sub Private Sub Class_Terminate() End Sub Public function addCard(byRef x) Redim Preserve cards(cardCount + 1) set cards(cardCount) = x cardCount = cardCount + 1 end function Public function numCards() numCards = cardCount - 1 end function Public function getCard(byVal x) set getCard = cards(x) end function Public function Sort( ByVal accessNum ) ' Linear insertion sort number of minutes in ascending order counter = 0 for base = 0 to numCards for i = base to 1 Step -1 counter = counter + 1 select case accessNum case NUM_0800 if CDbl(cards(i).Rate0800) < CDbl(cards(i-1).Rate0800) then swap cards(i), cards(i-1) else exit for end if case NUM_0207 if CDbl(cards(i).Rate0207) < CDbl(cards(i-1).Rate0207) then swap cards(i), cards(i-1) else exit for end if case NUM_0845 if CDbl(cards(i).Rate0845) < CDbl(cards(i-1).Rate0845) then swap cards(i), cards(i-1) else exit for end if end select next next end function Private function swap(byRef a, byRef b) set x = a set a = b set b = x end function End Class %>