Page 1 of 1
Arrays
Posted: Mon Sep 30, 2019 6:47 pm
by soa
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?
Re: Arrays
Posted: Mon Sep 30, 2019 11:24 pm
by Pablo
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
Re: Arrays
Posted: Mon Sep 30, 2019 11:39 pm
by René Houba
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é
Re: Arrays
Posted: Tue Oct 01, 2019 9:34 am
by soa
Thanks for the help guys!
Re: Arrays
Posted: Tue Oct 01, 2019 10:25 am
by dannyoorburg
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