Sorry for all the code but this is to give you an idea of my problem.Code:Public Structure ROO_1 Public Minutes As Byte Public Seconds As Byte End Structure Public Structure INFO_TYPE Public SetInfo As Integer Public BackTime As ROO_1 End Structure Public Structure PROGRAM_TYPE Public Programs As Byte Public Number As Byte Public Time As ROO_1 Public Information() As INFO_TYPE End Structure Public Structure MY_MAIN_TYPE Public Filename As String Public ProgramInformation() As PROGRAM_TYPE End Structure Public Function TestFunc() As MY_MAIN_TYPE Dim tmp As MY_MAIN_TYPE : ReDim tmp.ProgramInformation(16) Dim tmp_two As PROGRAM_TYPE : ReDim tmp_two.Information(8) 'ALSO TRIED THIS >> ReDim tmp.ProgramInformation(16).Information(8) tmp.ProgramInformation(0).Programs = 1 tmp.ProgramInformation(0).Number = 1 tmp.ProgramInformation(0).Time.Minutes = 4 tmp.ProgramInformation(2).Information(2).BackTime.Seconds = 43 ' << ALWAYS ERRORS Return tmp End Function
I always get an instance/object error. I've use 'redim' on ProgramInformation as I want it (16), a set size, but I can't seemed to find a way to do it to 'Information' in the program_type structure, obviously something to do with it being a structure in a structure no doubt, how do I get around this? I VB6 I could just declare the size/arraysize in the structure.
I've also tried the <VBFixedArray(8)> method, no luck.
Please Help.......




Reply With Quote