I started using a simple listbox but the data was never formatted correctly. So I tried the List View control and this looks better. I need two columns to hold the data. Here is my code:
method-id PopulateListbox final private.
local-storage section.
01 SiteList.
05 SiteListDesc pic x(40) value spaces.
05 Filler pic x(2) value spaces.
05 SiteListNum pic x(4) value spaces.
procedure division.
if ds-return = spaces
invoke lbxSites::BeginUpdate
invoke listView1::BeginUpdate
perform varying idx from 1 by 1 until idx > 99
if lb-siteentry(idx) > spaces
move LB-SITEENTRY-DESC(idx) to SiteListDesc
move LB-SITEENTRY-NUM(idx) to SiteListNum
invoke lbxSites::Items::Add(SiteList)
invoke listView1::Items::Add(SiteListDesc)
*>invoke listView1::SubItems::Add(SiteListNum)
else
exit perform
end-if
end-perform
invoke lbxSites::EndUpdate
invoke listView1::EndUpdate
end-if
end method.
In one of the Sams Teach Yourself books, it suggests using Subitems.Add code I have commented out above. The compiler doesn't like it. Can someone tell me how to fill in the second thru NN columns in a listview?
My form is below:
#ListView
#SubItems
#VisualCOBOL
