VLWEB allows me to define a collection like
Define_Com Class(#prim_lcol<#WRK3A>) Name(#MKS)
Where #WRK3A is a simple Dictionary *CHAR 3
But I can't work out how insert an entry
#MKS.Intert(#WRK3A) doesn't work (not a component)
Is there a way to achieve a simple string array?
Arrays
Re: Arrays
Hi soa,
Define_Com Class(#prim_lcol<#std_code>) Name(#MKS)
#mks.Insert Item(*New #std_code)
#mks.Last := "123"
#mks.Insert Item(*New #std_code)
#mks.Last := "345"
For Each(#item) In(#MKS)
#sys_web.Alert Caption(#item.Value)
Endfor
https://docs.lansa.com/14/en/lansa016/prim_lcol.htm
Regards,
Pablo
Define_Com Class(#prim_lcol<#std_code>) Name(#MKS)
#mks.Insert Item(*New #std_code)
#mks.Last := "123"
#mks.Insert Item(*New #std_code)
#mks.Last := "345"
For Each(#item) In(#MKS)
#sys_web.Alert Caption(#item.Value)
Endfor
https://docs.lansa.com/14/en/lansa016/prim_lcol.htm
Regards,
Pablo
-
René Houba
- Posts: 220
- Joined: Thu Nov 26, 2015 7:03 am
Re: Arrays
Hi soa,
Define_Com Class(#prim_lcol<#WRK3A>) Name(#MKS)
Define_Com Class(#WRK3A) Name(#FIELD_WRK3A)
#MKS.Insert Item(#FIELD_WRK3A)
Kind regards,
René
Define_Com Class(#prim_lcol<#WRK3A>) Name(#MKS)
Define_Com Class(#WRK3A) Name(#FIELD_WRK3A)
#MKS.Insert Item(#FIELD_WRK3A)
Kind regards,
René
-
dannyoorburg
- Posts: 177
- Joined: Mon Jan 04, 2016 9:50 am
- Location: Australia
Re: Arrays
Beware of the last one though.... You have to understand that prim_lcol stores object references and it has no problem with storing multiple references to the same object.
Which makes for some interesting side-effects if that's not what you meant.
Cheers,
Danny
Which makes for some interesting side-effects if that's not what you meant.
Cheers,
Danny