Collection in collections
Posted: Thu Sep 26, 2019 4:33 pm
I have a reusable part call #MARKENTRY which contains an array of strings like
Define_Pty Name(StudentId) Get(*AUTO #STDID) Set(*AUTO #STDID)
Define_Com Class(#PRIM_ACOL<#SMMKC2>) Name(#ItemMarkCol)
In my model RP I have a collection of MARKENTRYs
Define_Com Class(#PRIM_ACOL<#MARKEntry>) Name(#StdMarkCol)
Which I'm populating like
#iMarkEntry <= *New #MarkEntry
#iMarkEntry.StudentId := #STDID
#StdMarkCol.Insert( #iMarkEntry )
Which is great and I do this all the time
My problem is population the ItemMarkCol
I can code the following line which compiles but crashes at time with
#iMarkEntry.Marks<1> := #STDMKC_1
'Index 1 is outside the allowable range (1 to 0)
#iMarkEntry.Marks. doesn't have any methods such add or insert.
I don't know what I'm doing and the documentation doesn't help! Any ideas?
Define_Pty Name(StudentId) Get(*AUTO #STDID) Set(*AUTO #STDID)
Define_Com Class(#PRIM_ACOL<#SMMKC2>) Name(#ItemMarkCol)
In my model RP I have a collection of MARKENTRYs
Define_Com Class(#PRIM_ACOL<#MARKEntry>) Name(#StdMarkCol)
Which I'm populating like
#iMarkEntry <= *New #MarkEntry
#iMarkEntry.StudentId := #STDID
#StdMarkCol.Insert( #iMarkEntry )
Which is great and I do this all the time
My problem is population the ItemMarkCol
I can code the following line which compiles but crashes at time with
#iMarkEntry.Marks<1> := #STDMKC_1
'Index 1 is outside the allowable range (1 to 0)
#iMarkEntry.Marks. doesn't have any methods such add or insert.
I don't know what I'm doing and the documentation doesn't help! Any ideas?