home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a004 / 4.ddi / TUTORIAL / MENU.PRG < prev    next >
Encoding:
Text File  |  1988-01-17  |  1.3 KB  |  60 lines

  1. * Menu.prg generates main menu
  2.  
  3.  
  4. * Set up dBXL to run program
  5. SET TALK OFF
  6. SET BELL OFF
  7. SET SAFETY OFF
  8. CLEAR ALL
  9.  
  10. * Open databases, select work areas
  11. SELECT 1
  12. USE Customer INDEX Lastname, Custno, Ziplist AUTOMEM
  13. SELECT 2
  14. USE Invoices INDEX Invoices
  15.  
  16. * Initialize loop condition, begin main loop
  17. STORE .F. TO done
  18. DO WHILE .NOT. done
  19.  
  20.     * Display menu screen
  21.     CLEAR
  22.     @  3,0  SAY CENTER("SALES DEPARTMENT RESOURCE FILE")
  23.     @  6,5  SAY "Select one of the following operations:"
  24.     @  8,10 SAY "A.  Add new customers"
  25.     @ 10,10 SAY "B.  View/Edit existing customer records"
  26.     @ 12,10 SAY "C.  View invoice records"
  27.     @ 14,10 SAY "D.  Print mailing labels"
  28.     @ 16,10 SAY "E.  Print follow-up list"
  29.     @ 18,10 SAY "Q.  Quit and return to the dBXL prompt"
  30.  
  31.     * Get user's selection
  32.     STORE " " TO select
  33.     @ 20,5  SAY "Enter selection: ";
  34.     GET select PICTURE "!"
  35.     READ
  36.  
  37.     * Execute user's selection
  38.     DO CASE
  39.        CASE select = "A"
  40.        DO Addcust
  41.        CASE select = "B"
  42.        DO Viewedit
  43.        CASE select = "C"
  44.        DO Viewinvs
  45.        CASE select = "D"
  46.        DO Maillbls
  47.        CASE select = "E"
  48.        DO Callback
  49.        CASE select = "Q"
  50.        STORE .T. TO done
  51.     ENDCASE
  52. ENDDO
  53.  
  54. * Restore operating environment
  55. CLEAR
  56. SET BELL ON
  57. SET TALK ON
  58. SET SAFETY ON
  59. CLEAR ALL
  60.