Say I create a class called Farm. And it has 3 properties:
FarmName as StringNumberOfStables as LongHasHorse as Boolean
And I start the class
Dim SmithFarm as Farm
Set SmithFarm = New Farm
SmithFarm.FarmName = "Smith Farm"
SmithFarm.NumberOfStables = 3
Is there a way to create multiple copies of the HasHorse property? Say I want to know whether there's a horse in each of the Farm's Stables
Dim i As Long
For i = 1 To SmithFarm.NumberOfStables
SmithFarm.HasHorse(i) = True
Next
So now SmithFarm would have Stable 1, Stable 2 and Stable 3 - all with horses that I can rent out and keep track of how many horses I have in the farm stables -
Dim currentHorses As Long
For i = 1 To SmithFarm.NumberOfStables
If SmithFarm.HasHorse(i) Then currentHorses = currentHorses + 1
Next
Or maybe I want to see if the second stable has a horse-
Dim targetStable As Long
targetStable = 2
If Not SmithFarm.HasHorse(targetStable) Then MsgBox "There's no horse here!"
How would one accomplish this? I know the code above won't work, but is there a way around this? Do I need a Class of Stables to use from the Farm Class? Or do I need a Collection of Stables that's stored somewhere else and named for the farm?
