VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "clsOrder2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
' Retail example #4
' ActiveX: Guide to the Perplexed
' Copyright (c) 1997 by Desaware Inc.

Option Explicit

Dim ItemList() As Integer
Public AssociatedMenu As clsMenu2

' Start the array off with at least one entry
Private Sub Class_Initialize()
   ReDim ItemList(0)
End Sub

' Clear the current order
Public Sub Clear()
   Dim entry%
   For entry = 0 To UBound(ItemList)
      ItemList(entry) = 0
   Next entry
End Sub

' The quantity of a particular menu item

Public Property Get Quantity(ByVal itemnum%) As Integer
   ' Invalid value, just return zero
   If itemnum > UBound(ItemList) Then Exit Property
   Quantity = ItemList(itemnum)
End Property

Public Property Let Quantity(ByVal itemnum%, ByVal iNewQuantity As Integer)
   If itemnum > UBound(ItemList) Then
      ReDim Preserve ItemList(itemnum)
   End If
   ItemList(itemnum) = iNewQuantity
End Property
