home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / olbox100.zip / test.cmd < prev   
OS/2 REXX Batch file  |  1999-06-08  |  1KB  |  46 lines

  1. /* test.cmd, Antal Koos */
  2.  
  3. Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs';
  4. Call SysLoadFuncs;
  5.  
  6. kF1=d2c(0)||d2c(59);/* Try pkey.cmd! */ 
  7. kF5=d2c(0)||d2c(63);
  8. kF3=d2c(0)||d2c(61); 
  9.  
  10. list.0=10;
  11. do i=1 to 10
  12.    list.i=date('L',date('B')+i,'B');
  13. end;
  14.  
  15. menu= .OLBox~new( list.); 
  16. menu~SetCorner( 25,5);
  17. menu~SetHeight( 6);
  18. menu~SetDefaultItem( 8);
  19. menu~SetMulSelection(.true);
  20. /* menu~SetMulSelection(.true,kF3); */
  21.  
  22. F5func="i=LD.SItem; item.i=reverse(item.i); refresh=.true;";
  23. F1func="Call SysCurPos 1,1; i=LD.SItem; say left('What are you going to do on '||item.i||'?',70);";
  24.  
  25. menu~SetUserFunc(kF5,F5func );
  26. menu~SetuserFunc(kF1,F1func);
  27.  
  28. Call SysCls;
  29. say 'F1: demo1; F5: demo2; Space: toggle selection';
  30. rtcd= menu~Execute; /* Displaying listbox. */
  31.  
  32. Call SysCurPos 15,1;
  33. if rtcd then say 'Selection accepted.'
  34. else say 'Selection canceled.';
  35.  
  36. say 'Selected items:';
  37. found.=menu~GetFirstSelected;
  38. do while found.index>0
  39.     say 'index='found.index' str='found.str;
  40.     found.=menu~GetNextSelected;
  41. end /* do */
  42.  
  43. EXIT;
  44.  
  45. ::REQUIRES 'olbox.cmd'
  46.