home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP14.EXE / CHP1404.PRG < prev    next >
Encoding:
Text File  |  1991-06-12  |  1.0 KB  |  31 lines

  1. /*
  2.    Listing 14.4 ACHOICE() Menu with Parallel Logical Array
  3.    Author: Greg Lief
  4.    Excerpted from "Clipper 5: A Developer's Guide"
  5.    Copyright (c) 1991 M&T Books
  6.                       501 Galveston Drive
  7.                       Redwood City, CA 94063-4728
  8.                       (415) 366-3600
  9. */
  10.  
  11. //───── NOTE: must compile with the /N option!
  12.  
  13. #include "box.ch"
  14.  
  15. function pick_a_day
  16. local days := { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", ; 
  17.                 "Friday", "Saturday" }, sel := 0, available := array(7) 
  18. local oldscrn := savescreen(8, 35, 16, 45)
  19. afill(available, .t.)                    // load parallel array
  20. available[dow(date())] = .f.             // toggle current day
  21. @ 8, 35, 16, 45 box B_SINGLE + " " color "+W/R"
  22. //───── do not allow user to Esc out, which would cause array access error
  23. do while sel == 0
  24.    sel := achoice(9, 36, 15, 44, days, available)
  25. enddo 
  26. //───── restore previous screen contents and color
  27. restscreen(8, 35, 16, 45, oldscrn) 
  28. return days[sel]
  29.  
  30. //───── end of file CHP1404.PRG
  31.