Original Post
I say:
And VB says:
As VB says:
quoteth VB:
''Module ReportInfo
Public Type CostInfoChunk
Level As Integer
BaseID As String
LotID As String
SubID As String
End Type
Public Type CostInfo
Info() As CostInfoChunk
MaterialCost As Currency
End Type
''WorkOrder class
Dim m_MaterialCostCollection as Collection
''...
Dim CI as ReportInfo.CostInfo
CI.Info(1..n) = ''stuff
CI.MaterialCost = SumMaterialCost(CI)
m_MaterialCostCollection.Add(CI)
|
quote:At the .Add <scratches head> ummm, it IS a user-defined type in a public module!!!! so I says fine:
Compile error: Only user-defined types defined in public object modules can be coerced to or from a variant or passed to late-bound functions
''Class CostInfo Public Info() As ReportInfo.CostInfoChunk Public MaterialCost As Currency |
quote:Right, it''d be way too danergous to let a VB program to that... Fine, I''ll give in to the dark-side
Constant, fixed-length strings, arrays, user-defined types and Declare statements not allowed as public members of object modules
Dim m_Info() As ReportInfo.CostInfoChunk
Dim m_MaterialCost As Currency
Property Set Info(i As Integer, chunk As ReportInfo.CostInfoChunk)
Info(i) = chunk
End Property
Property Get Info(i As Integer) As ReportInfo.CostInfoChunk
Info = m_Info(i)
End Property
|
quote:(at the Property Set) AAAAAAAARRRRRRRRRRRRRGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHH Please, someone tell me how stupid I am, and give me a clue how to make a collection of a UDT? (VB6 SP5) Magmai Kai Holmlor "Oh, like you''ve never written buggy code" - Lee "What I see is a system that _could do anything - but currently does nothing !" - Anonymous CEO
Compile Error: Only public user defined typed define in public modules can be used as parameters or return types for public procedure of class modules or as fields of public user defined types