VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "PetStore2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
' Guide to the Perplexed:
' Rabbit1 example
' Copyright (c) 1997 by Desaware Inc. All Rights Reserved

Option Explicit

Private m_Hutch As Collection

' The petstore lets you buy a collection of rabbits
Public Sub BuyRabbits(ByVal RabbitCount As Integer)
    Dim counter%
    Dim col As New Collection
    Dim obj As clsRabbit2
    ' Create the requested number of rabbits
    For counter = 1 To RabbitCount
        Set obj = New clsRabbit2
        col.Add obj
    Next counter
    ' Return a collection containing the rabbits
    Set m_Hutch = col
End Sub

' Access items in the rabbit hutch
Public Function Hutch(ByVal idx%) As clsRabbit2
    Set Hutch = m_Hutch(idx)
End Function

' Retrieve the number of rabbits
Public Function RabbitCount()
    RabbitCount = m_Hutch.Count
End Function

' Enumerate Rabbits using For..Each
Public Sub InoculateAll1()
    Dim obj As clsRabbit2
    For Each obj In m_Hutch
        obj.Inoculate
    Next
End Sub

' Enumerate Rabbits using counter
Public Sub InoculateAll2()
    Dim obj As clsRabbit2
    Dim counter As Integer
    For counter = 1 To m_Hutch.Count
        Set obj = m_Hutch.Item(counter)
        obj.Inoculate
    Next
End Sub
