Hi all,
I have a class module with several private variables, including one that is an array of a user-defined type. I am trying to set the values of a single element of this array with "Property Let ..." from a string array:
Public Property Let EnterMFSwap(ByVal index As Integer, ByRef values() As String)
MFSwaps_(index).Name = values(0)
MFSwaps_(index).Units = values(1)
MFSwaps_(index).Notional = values(2)
MFSwaps_(index).Fee = values(3)
MFSwaps_(index).Daycount = values(4)
MFSwaps_(index).PFP = values(5)
MFSwaps_(index).PFR = values(6)
MFSwaps_(index).TradeDate = values(7)
MFSwaps_(index).EffectiveDate = values(8)
MFSwaps_(index).Maturity = values(9)
MFSwaps_(index).Leg1 = values(10)
MFSwaps_(index).Leg2 = values(11)
MFSwaps_(index).Holidays = values(12)
MFSwaps_(index).SettleRule = values(13)
MFSwaps_(index).Underlying = values(14)
End Property
In my test code, I set all of the string array variables, and try to set it using:
temporary.EnterMFSwap(outer) = tempString
And get the following error message:
"Compile error: Can't assign to array"
Is there a way to set the values in the user-defined type this way? I could do it by creating a temporary variable of the User-defined type and then there is no problem, but this is used by a lot of very old code as well that gives the needed values as an array.
Thanks in advance
Bookmarks