-
Public Property Get Prom_Data(ByVal Row As Long, _
ByVal Col As colProm) As Variant
If (mvarProm_Count >= Row) Then
Select Case Col
Case ipID
Prom_Data = aryP(Row).Prom_ID
Case ipName
Prom_Data = aryP(Row).Prom_Name
Case ipExpense
Prom_Data = aryP(Row).Prom_Expense
Case ipCollection
Prom_Data = aryP(Row).Prom_Collection
Case ipGST
Prom_Data = aryP(Row).Prom_GST
Case ipMemberGST
Prom_Data = aryP(Row).Prom_Member_GST
Case ipMemberCount
Prom_Data = aryP(Row).Prom_Member_Count
Case ipPercentage
Prom_Data = aryP(Row).Prom_Percentage
End Select
Else
Err.Raise vbObjectError, "iReconcile-Prom_Data_Get", "Subscript out of
range"
End If
End Property
'--------------------------------------------------------------------
Public Property Let Prom_Data(ByVal Row As Long, _
ByVal Col As colProm, _
ByVal Value As Variant)
On Error GoTo errhandler
If (mvarProm_Count = -1) Then
ReDim aryP(Row) As udtPromotion
ElseIf (Row > mvarProm_Count) Then
ReDim Preserve aryP(0) As udtPromotion
End If
mvarProm_Count = Row
Select Case Col
Case ipID
aryP(Row).Prom_ID = Value
Case ipName
aryP(Row).Prom_Name = Value
Case ipExpense
aryP(Row).Prom_Expense = Value
Case ipCollection
aryP(Row).Prom_Collection = Value
Case ipGST
aryP(Row).Prom_GST = Value
Case ipMemberGST
aryP(Row).Prom_Member_GST = Value
Case ipMemberCount
aryP(Row).Prom_Member_Count = Value
Case ipPercentage
aryP(Row).Prom_Percentage = Value
End Select
Exit Property
errhandler:
Err.Raise vbObjectError, "iReconcile-Prom_Data_Let", Err.Description
End Property
Quote:
> Hi
> Anyone have any ideas how to build a property array in a class ?
> A property is simple. But I'd like the property to look like this...
> Object.myproperty(1) = "MyText"
> Object.myproperty(9) = "MyText"
> Something like this. How do you set a property to be an array ?
> Any suggestions are most appreciated.
> Thanx
> Steve