M
medicenpringles
i'm having a problem with one of my classes. i have 2 methods in my
class(among others):
Code:
--------------------
Property Let IngredientName(Index As Integer, sName As String)
If rgSandwich Is Nothing Then
IngredientName = ""
Else
rgSandwich.Offset(0, Index + 2).Value = sName
End If
End Property
Property Get IngredientName(Index As Integer) As String
If rgSandwich Is Nothing Then
UninitializedError
Else
IngredientName = rgSandwich.Offset(0, Index + 2).Value
End If
End Property
--------------------
and a macro in a module:
Code:
--------------------
Sub Testing()
Dim oSandwich As Sandwich
Dim oSandwiches As New Sandwiches
Set oSandwich = oSandwiches.Add("Testing Sandwich")
With oSandwich
.Name = "Testing Sandwich"
.Size = "Yeah"
' (see below)
End With
End Sub
--------------------
i want to be able to have something like .IngredientName(1) =
"Tomatoes" or .IngredientName(3) = "Sauce" where the "(see below)"
comment is, but i'm not sure on how to structure my properties in order
to do so. does anyone know how i can do this?
thanks ahead of time,
sven
class(among others):
Code:
--------------------
Property Let IngredientName(Index As Integer, sName As String)
If rgSandwich Is Nothing Then
IngredientName = ""
Else
rgSandwich.Offset(0, Index + 2).Value = sName
End If
End Property
Property Get IngredientName(Index As Integer) As String
If rgSandwich Is Nothing Then
UninitializedError
Else
IngredientName = rgSandwich.Offset(0, Index + 2).Value
End If
End Property
--------------------
and a macro in a module:
Code:
--------------------
Sub Testing()
Dim oSandwich As Sandwich
Dim oSandwiches As New Sandwiches
Set oSandwich = oSandwiches.Add("Testing Sandwich")
With oSandwich
.Name = "Testing Sandwich"
.Size = "Yeah"
' (see below)
End With
End Sub
--------------------
i want to be able to have something like .IngredientName(1) =
"Tomatoes" or .IngredientName(3) = "Sauce" where the "(see below)"
comment is, but i'm not sure on how to structure my properties in order
to do so. does anyone know how i can do this?
thanks ahead of time,
sven