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

  1. * Maillbls.prg generates labels for brochures and customer
  2. * mailings
  3.  
  4.  
  5. * Select database Customer with index Ziplist
  6. SELECT Customer
  7. SET INDEX TO Ziplist, Lastname, Custno
  8.  
  9. * Display menu
  10. CLEAR
  11. @  3,0    SAY CENTER("MAILING LABEL GENERATOR")
  12. @  8,5    SAY "Select what labels are to be used for:"
  13. @ 10,10 SAY "A.  Brochures to new customers"
  14. @ 12,10 SAY "B.  Mailing to all customers"
  15. @ 14,10 SAY "Q.  Quit and return to main menu"
  16.  
  17. * Get the user's selection
  18. STORE " " TO select
  19. @ 16,5    SAY "Enter selection: ";
  20.     GET select PICTURE "!"
  21. READ
  22.  
  23. * Quit if requested, otherwise prepare to print labels
  24. IF select = "Q"
  25.     RETURN
  26. ELSE
  27.  
  28.     * Pause until user is ready
  29.     WAIT "     Prepare printer. Hit any key to begin "+;
  30.     "printing labels."
  31.  
  32.     * Print sample label
  33.     CLEAR
  34.     @ 11,0  SAY "Printing a sample label"
  35.  
  36.     * Print labels as directed by user's selection
  37.     IF select = "A"
  38.  
  39.     * Determine if there are any customers that
  40.     * have not been sent brochures
  41.     LOCATE FOR .NOT. Sent_bro
  42.     IF FOUND()
  43.         LABEL FORM Customer FOR .NOT. Sent_bro SAMPLE TO PRINT
  44.         REPLACE ALL Sent_bro WITH .T. FOR .NOT. Sent_bro
  45.     ELSE
  46.  
  47.         * Display message that no labels will print
  48.         @ 10,0 SAY "All customers have been sent brochures"
  49.         WAIT
  50.     ENDIF
  51.     ELSE
  52.     LABEL FORM Customer SAMPLE TO PRINT
  53.     ENDIF
  54. ENDIF
  55.  
  56. * Return to Menu.prg
  57. RETURN
  58.