home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / pcmagazi / 1992 / 12 / tslist.prg < prev    next >
Text File  |  1992-03-08  |  1KB  |  60 lines

  1. *
  2. * TSLIST.PRG - Try the SLIST function
  3. *
  4. CLEAR
  5. OldColor = SET("COLOR")
  6. SET COLOR TO W+/R
  7. pcmag="PC Magazine Databases PC Magazine Databases PC Magazine Data"+;
  8.       "bases PC Magazine "
  9. @ 1, 0, 24, 79 BOX
  10. FOR i = 2 TO 23
  11.    @ i, 1 SAY pcmag
  12. ENDFOR
  13.  
  14. DIMENSION aAvail(14)
  15. aAvail(1)="Apples"
  16. aAvail(2)="Bananas"
  17. aAvail(3)="Cherries"
  18. aAvail(4)="Dates"
  19. aAvail(5)="Elderberries"
  20. aAvail(6)="Figs"
  21. aAvail(7)="Grapes"
  22. aAvail(8)="Honeydew"
  23. aAvail(9)="Kiwis"
  24. aAvail(10)="Lemons"
  25. aAvail(11)="Prunes"
  26. aAvail(12)="Jolt"
  27. aAvail(13)="Coffee"
  28. aAvail(14)="Chocolate"
  29.  
  30. DIMENSION aSelected(ALEN(aAvail))
  31.  
  32. nCount = slist( @aAvail, @aSelected, " Select some snacks ")
  33.  
  34. SET COLOR TO &OldColor
  35. CLEAR
  36. IF nCount > 0
  37.   ? ALLTRIM(STR(nCount))+" item(s) were selected."
  38.   FOR x = 1 TO nCount
  39.      ? PADL(ALLT(STR(x)),2)+" : "+aSelected(x)
  40.   ENDFOR
  41. ELSE
  42.   ? "No items were selected."
  43. ENDIF
  44.  
  45. WAIT
  46.  
  47. FOR i = 1 to ALEN(aAvail)
  48.  ? "aAvail("+ALLTRIM(STR(i))+") = "
  49.  ?? aAvail(i)
  50. ENDFOR
  51.  
  52. WAIT
  53.  
  54. FOR i = 1 to ALEN(aSelected)
  55.  ? "aSelected("+ALLTRIM(STR(i))+") = "
  56.  ?? aSelected(i)
  57. ENDFOR
  58.  
  59. RETURN
  60.