home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a070 / 3.ddi / FOXPRO / SAMPLE / SALELIST.PRG < prev    next >
Encoding:
Text File  |  1989-11-07  |  1.6 KB  |  64 lines

  1. * ┌─────────────────────────────────────────────────────────────────────┐ *
  2. * │  SALELIST.PRG: SALESREPSON LIST                                     │ *
  3. * │  Copyright (c) 1989 Tech III, Inc. All rights reserved.             │ *
  4. * │  Tech III of San Pedro, California      (213) 547-2191.             │ *
  5. * │  "The bridge connecting people and technology."(tm)                 │ *
  6. * └─────────────────────────────────────────────────────────────────────┘ *
  7. @ 00,00 SAY WINTITLE(PROMPT())
  8.  
  9. * FILE HANDLING
  10. SELECT salesrep
  11. SET ORDER TO sal_nam
  12. GO TOP
  13.  
  14. * DEFINITIONS
  15. ON ESCAPE STORE .f. TO printing
  16. STORE 'PRINTER' TO output
  17.  
  18. @ 02,02 SAY '  Direct report to: PRINTER/SCREEN: ' ;
  19. GET output PICTURE '@M PRINTER,SCREEN '
  20. READ
  21.  
  22.  
  23. GO TOP
  24. STORE .t. TO printing
  25. IF .NOT. YESNO("System is ready to run report.")
  26.   STORE .f. TO printing
  27. ELSE
  28.   IF output<> "SCREEN "
  29.     IF .NOT. READY2PR()
  30.       STORE .f. TO printing
  31.     ENDIF
  32.   ENDIF
  33. ENDIF
  34.  
  35. * START PRINTING
  36. IF printing
  37.   IF output = 'PRINTER'
  38.     REPORT FORM salelist NOEJECT TO PRINT WHILE printing
  39.   ELSE
  40.     REPORT FORM salelist NOEJECT TO FILE report.txt WHILE printing
  41.     SELECT 0
  42.     USE system
  43.     LOCATE FOR LABEL = 'SALELIST: '
  44.     IF EOF()
  45.       APPEND BLANK
  46.     ELSE
  47.       REPLACE NEXT 1 contents WITH ''
  48.     ENDIF
  49.     REPLACE LABEL WITH 'SALELIST: '  + DTOC(DATE())
  50.     APPEND MEMO contents FROM report.txt
  51.     MODIFY MEMO contents NOEDIT WINDOW reportview
  52.     USE
  53.     SELECT invoice
  54.   ENDIF
  55.   DO standby WITH 'Your report request has been completed.'
  56. ELSE
  57.   DO standby WITH 'You have canceled this report.'
  58. ENDIF
  59. ON ESCAPE
  60. RETURN
  61.  
  62. * EOF
  63.  
  64.