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

  1. * Callback.prg prints report of customers that need to be
  2. * contacted
  3.  
  4. * Get groups of customers to be included in the list
  5. CLEAR
  6. @  3,0    SAY CENTER("FOLLOW-UP LIST GENERATOR")
  7. @  7,5    SAY "Select who should be included in follow-up list:"
  8. @  9,10 SAY "A. Customers sent brochures but not called back"
  9. @ 11,10 SAY "B. Customers not contacted in the last 3 months"
  10. @ 13,10 SAY "C. All customers located in a particular city"
  11. @ 15,10 SAY "Q. Quit and return to main menu"
  12. STORE " " TO selectin
  13. @ 17,5    SAY "Enter selection: ";
  14.     GET selectin PICTURE "!"
  15. READ
  16.  
  17. * Formulate filter condition
  18. STORE " " TO conditn
  19. DO CASE
  20.     CASE selectin = "A"
  21.     STORE "(Sent_bro .AND. .NOT. Follow_up)" TO conditn
  22.     CASE selectin = "B"
  23.     STORE "(DATE() - Contacted > 90)" TO conditn
  24.     CASE selectin = "C"
  25.     * Get name of customer's city
  26.     STORE SPACE(15) TO cityname
  27.     @ 19,5    SAY "Enter name of city: ";
  28.         GET cityname
  29.     READ
  30.     STORE "(City = cityname)" TO conditn
  31.     CASE selectin = "Q"
  32.     RETURN
  33. ENDCASE
  34.  
  35. * Select database Customer with index Lastname
  36. SELECT Customer
  37. SET INDEX TO Lastname, Custno, Ziplist
  38.  
  39. * Set and activate filter
  40. SET FILTER TO &conditn
  41. GO TOP
  42.  
  43. * Print out report
  44. WAIT "     Prepare printer. Press any key to begin printing. "
  45. SET DEVICE TO PRINT
  46.  
  47. * Do while not all records have been printed
  48. DO WHILE .NOT. EOF()
  49.     @  7,32 SAY "FOLLOW-UP CALLS"
  50.     STORE 10 TO currline
  51.  
  52.     * Do while page is not full
  53.     DO WHILE currline<=50 .AND. .NOT. EOF()
  54.     @   currline,5    SAY TRIM(Firstname) + " " + Lastname
  55.     @   currline,60 SAY Telephone
  56.     @ currline+1,5    SAY Company
  57.     @ currline+2,5    SAY Address
  58.     @ currline+3,5    SAY TRIM(City) + ", " + State + "  " + Zip
  59.     IF Sent_bro .AND. .NOT. Follow_up
  60.         @ currline+5,5  SAY "Brochure sent, no follow-up call made"
  61.     ELSE
  62.         @ currline+5,5  SAY "Brochure sent, follow-up call made"
  63.     ENDIF
  64.     @ currline+6,5    SAY "LAST CONTACTED: " + DTOC(Contacted)
  65.     STORE currline+9 TO currline
  66.     SKIP
  67.     ENDDO
  68.     EJECT
  69. ENDDO
  70. SET DEVICE TO SCREEN
  71. SET FILTER TO
  72. RETURN
  73.