home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 26.2 Displaying Pop-up picklists with WHEN
- Author: Greg Lief
- Excerpted from "Clipper 5: A Developer's Guide"
- Copyright (c) 1991 M&T Books
- 501 Galveston Drive
- Redwood City, CA 94063-4728
- (415) 366-3600
- */
-
- //───── NOTE: must compile with the /N option!
-
- //───── the following manifest constant allows you to use the APICK()
- //───── function in the Grumpfish Library.... if you don't have Grumpfish
- //───── Library, remove the following line and call (503) 588-1815 for a
- //───── free demonstration package
- #define GRUMPLIB
-
- #ifndef GRUMPLIB
- #translate APick( <list,...> ) => AChoice( <list> )
- #endif
-
- function main
- local days := { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"}
- local mday := space(9), mmonth := space(9)
- local months := { "January", "February", "March", "April", "May", "June", ;
- "July", "August", "September", "October", "November", "December" }
- cls
- @ 0, 10 say "Day: " get mday when ;
- ! empty(mday := days[ max(apick(9, 34, 15, 44, days), 1) ])
- @ 1, 10 say "Month:" get mmonth when ;
- ! empty(mmonth := months[ max(apick(8, 34, 16, 44, months), 1) ] )
- read
- return nil
-
- // end of file CHP2602.PRG
-