*c32 -m lvdatum.cob;slink lvdatum id division. data division. working-storage section. 01 mdial usage maindialog left 300 top 200 height 375 width 406 font 'arial' title 'Listview nach Datum sortieren'. 02 filler usage static left 0 top 30 Height 20 width 405 center title 'Zum Sortieren das Datumsfeld anklicken'. 02 lview usage listview left 10 top 60 width 380 height 220 notify-header gridstyle 3 id 10. 05 lview-aus. 10 lview-pos pic zz9 usage column width 50 rightadjust title 'Pos'. 10 lview-datum pic x(10) usage column center width 80 title 'Datum'. 10 lview-text pic x(50) usage column width 250 title 'Text'. 10 lview-sdatum pic 9(8) usage column hide. 02 filler usage pushbutton left 160 top 300 width 80 height 24 id 20 title 'Beenden'. 01 bnr pic 9(5). 02 bid pic 99. 02 filler pic 999. 01 col pic 9(4). procedure division. display mdial. * Listview füllen move '10.02.2011' to lview-datum. move 20110210 to lview-sdatum. move 1 to lview-pos. move 'Anmeldung' to lview-text. call additem using lview lview-aus. move '02.01.2010' to lview-datum. move 20100201 to lview-sdatum. move 'Start' to lview-text. move 2 to lview-pos. call additem using lview lview-aus. move '14.02.2010' to lview-datum. move 20100214 to lview-sdatum. move '3. Testlauf' to lview-text. move 3 to lview-pos. call additem using lview lview-aus. move '19.03.2010' to lview-datum. move 20100319 to lview-sdatum. move 4 to lview-pos. move 'Fehlerbericht' to lview-text. call additem using lview lview-aus. move '15.01.2011' to lview-datum. move 20110115 to lview-sdatum. move 5 to lview-pos. move 'Abschlußtest' to lview-text. call additem using lview lview-aus. loop. call waitbox using bnr mdial. monitor bnr. if bid < 0 stop run. evaluate bid when 10 perform lviewsec when 20 stop run. go to loop. lviewsec section. call checklvheader using lview col. monitor 'lviewsec: Column ' col. * Ist col = 0 wurde nicht der Header angeklickt. if col < 1 exit section. if col = 2 move 4 to col. * Nach Spalte sortieren: 0 alternierend, 1 aufsteigend, 2 absteigend if col < 1000 call sortlv using lview col 0.