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

  1. /*
  2.    Listing 26.2 Displaying Pop-up picklists with WHEN
  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. //───── the following manifest constant allows you to use the APICK()
  14. //───── function in the Grumpfish Library.... if you don't have Grumpfish
  15. //───── Library, remove the following line and call (503) 588-1815 for a
  16. //───── free demonstration package
  17. #define GRUMPLIB
  18.  
  19. #ifndef GRUMPLIB
  20.    #translate APick( <list,...> ) => AChoice( <list> )
  21. #endif
  22.  
  23. function main
  24. local days := { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"}
  25. local mday := space(9), mmonth := space(9)
  26. local months := { "January", "February", "March", "April", "May", "June", ;
  27.         "July", "August", "September", "October", "November", "December" }
  28. cls
  29. @ 0, 10 say "Day:  " get mday when ;
  30.        ! empty(mday := days[ max(apick(9, 34, 15, 44, days), 1) ])
  31. @ 1, 10 say "Month:" get mmonth when ;
  32.        ! empty(mmonth := months[ max(apick(8, 34, 16, 44, months), 1) ] )
  33. read
  34. return nil
  35.  
  36. // end of file CHP2602.PRG
  37.