home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol110 / report.acg < prev    next >
Encoding:
Text File  |  1984-04-29  |  2.4 KB  |  114 lines

  1.  
  2. * report.cmd 03/15/83  hmvt
  3. * note - only phone and wordstar list programs have been written
  4.  
  5. * present report menu
  6. SET FORMAT TO SCREEN
  7. ERASE
  8.  
  9. * set up loop to repeat until user is done
  10. STORE t TO notend
  11. DO WHILE notend
  12.  
  13. STORE ' ' TO printer
  14. STORE ' ' TO disk
  15. STORE '        ' TO filename
  16. STORE '?' TO command
  17.  
  18. * display first half of menu
  19. ERASE
  20. @  1,22 SAY "> > >  R E P O R T  M E N U  < < <"
  21. @  2, 0 SAY "--------------------------------------------------------------------------------"
  22. @  4,25 SAY "1. Print list by Last Names"
  23. @  6,25 SAY "2. Print list by Companys"
  24. @  8,25 SAY "3. Print list by Zipcodes"
  25. @ 10,25 SAY "4. Print phone number list"
  26. @ 12,25 SAY "5. Make WordStar-MailMerge Files"
  27. @ 14,25 SAY "6. Return to Main Menu"
  28. @ 16, 0 SAY "--------------------------------------------------------------------------------"
  29. @ 17,30 SAY "WHAT NEXT"
  30. @ 17,40 GET command PICTURE '!'
  31. READ
  32.  
  33. * if a report is requested then do second half of menu
  34. IF command  >'0' .AND. command <  '5'
  35.  
  36. @ 19,22 SAY "Send Report to the Printer (Y\N)"
  37. @ 19,55 GET printer PICTURE '!'
  38. READ
  39.  
  40. @ 21,22 SAY "Send Report to a Disk File (Y\N)"
  41. @ 21,55 GET disk PICTURE '!'
  42. READ
  43.  
  44. * only aks for filename if disk file was requested
  45. IF disk ='Y'
  46.   @ 23,33 SAY "Enter Disk File Name"
  47.   @ 23,55 GET filename PICTURE '!!!!!!!!'
  48.   @ 23,65 SAY "(.TXT added )"
  49.   READ
  50. ENDIF
  51.  
  52. * set up printer is necessary
  53. IF printer = 'Y'
  54.   SET print ON
  55. ENDIF
  56.  
  57. * send the report to a text file if disk is yes
  58. * and a filename has been given
  59. IF disk = 'Y' .AND. filename <> ' '
  60.     * make a proper REPORT file name that is of type TXT
  61.     STORE $(filename,1,8) TO filename
  62.     STORE filename+'.TXT' TO filename
  63.   SET ALTERNATE TO &filename
  64.   SET ALTERNATE ON
  65. ENDIF
  66. ENDIF
  67. * clear the screen for the report
  68. ERASE
  69.  
  70. * do the requested report
  71. DO CASE
  72.  
  73.     CASE command = '1'
  74.         SET index TO lastname 
  75.         REPORT FORM namelist 
  76.  
  77.         CASE command = '2'
  78.         SET index TO company 
  79.         REPORT FORM companies
  80.  
  81.     CASE command = '3'
  82.     SET INDEX TO zip       
  83.         REPORT FORM zips
  84.  
  85.     CASE command = '4'
  86.         DO phone.acg
  87.  
  88.     CASE command = '5'
  89.     DO wsfile.acg
  90.  
  91.     CASE (command = '6' .OR. COMMAND = 'Q')
  92.     STORE f TO notend
  93.  
  94. ENDCASE
  95.  
  96. * turn off the printer and disk file
  97. * if they were already off - this means nothing
  98. SET PRINT OFF
  99. SET ALTERNATE OFF
  100.  
  101.  
  102. ENDDO 
  103.  
  104.  
  105. * release the local variables
  106. RELEASE ALL
  107.  
  108. * restore the original variables
  109. STORE t TO more
  110. STORE '?' TO command
  111.  
  112. * restore the proper indices
  113. SET index TO lastname, company, zip 
  114.