home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol285 / report.prg < prev    next >
Encoding:
Text File  |  1986-12-22  |  5.8 KB  |  202 lines

  1. **    Last revision: April 17, 1986 at 18:54
  2. * report.prg
  3. STOR .t. TO more1
  4. DO WHIL more1
  5.  CLEA
  6.  STOR 'D' TO dr
  7.  STOR 'Y' TO printer
  8.  STOR 'N' TO disk
  9.  STOR '        ' TO filename
  10.  STOR ' ' TO comman1
  11.  STOR CDOW(DATE())+' '+CMONTH(DATE())+' '+STR(DAY(DATE()),2)+", "+STR(YEAR(DATE()),4) TO mday
  12.  STOR 'REPORT MENU' TO mode
  13.  SET COLOR TO &revvideo
  14.  @ 1,00
  15.  @ 1,01 SAY mday
  16.  @ 1,35 SAY mode
  17.  SET COLOR TO &stdvideo
  18.  @ 3,14 SAY "A. Print all data on list"
  19.  @ 4,14 SAY "B. Print all records updated after a set date"
  20.  @ 5,14 SAY "C. Print telephone Listing"
  21.  @ 06,14 SAY "D. Prepare compact listing"
  22.  @ 07,14 SAY "E. Prepare labels"
  23.  @ 08,14 SAY "F. Prepare special report"
  24.  @ 09,14 SAY "G. Display records on screen"
  25.  @ 10,14 SAY "H. Make WordStar-MailMerge File of all records"
  26.  @ 11,14 SAY "I. Make WordStar-MailMerge File of part of the records"
  27.  @ 12,14 SAY "J. Return to Main Menu"
  28.  @ 16, 0 SAY line
  29.  @ 17,33 SAY 'SELECT:'
  30.  DO WHIL AT(comman1,'ABCDEFGHIJQ')=0
  31.   @ 17,43 GET comman1 PICTURE '!'
  32.   READ
  33.   CLEA GETS
  34.  ENDD
  35.  STOR 'Y' TO howmuch
  36.  STOR SPACE(12) TO much
  37.  IF (comman1 >='A'.AND.comman1 <='E').OR.(comman1 >='G'.AND.comman1 <= 'I')  
  38.   @ 19,10 SAY 'Do you want to include all records in the file '
  39.   @ 19,60 GET howmuch PICTURE '!'
  40.   READ
  41.   DO WHIL AT(howmuch,'YN')=0
  42.    @ 19,60 GET howmuch PICTURE '!'
  43.    READ
  44.    CLEA GETS
  45.   ENDD
  46.   IF howmuch = 'N'
  47.    @ 20,15 SAY 'Which lists do you want to include '
  48.    DO WHIL SUBSTR(much,1,1)=' '
  49.     @ 20,53 GET much PICTURE '!!!!!!!!!!!!'
  50.     READ
  51.    ENDD
  52.    STOR TRIM(much) TO much
  53.    STOR LEN(much) TO count
  54.    STOR "CS1= '"+SUBSTR(much,count,1)+"'" TO fill
  55.    STOR count -1 TO count
  56.    DO WHIL count > 0
  57.     STOR fill+" .OR.CS1= '"+SUBSTR(much,count,1)+"'" TO fill
  58.     STOR count -1 TO count
  59.    ENDD
  60.    SET FILTER TO &fill
  61.    GO TOP
  62.   ENDI howmuch
  63.  ENDI comman1
  64.  IF comman1 >='A' .AND. comman1 <  'E'
  65.   @ 21,22 SAY "Send Report to the Printer (Y/N)"
  66.   @ 21,55 GET printer PICTURE '!'
  67.   READ
  68.   DO WHIL AT(printer,'YN')=0
  69.    @ 21,55 GET printer PICTURE '!'
  70.    READ
  71.   ENDD
  72.  ENDI comman1
  73.  IF comman1 >='A' .AND. comman1 < 'E'
  74.   @ 22,22 SAY "Send Report to a Disk File (Y/N)"
  75.   @ 22,55 GET disk PICTURE '!'
  76.   READ
  77.   DO WHIL AT(disk,'YN')= 0
  78.    @ 22,55 GET disk PICTURE '!'
  79.    READ
  80.   ENDD
  81.   IF disk ='Y'
  82.    @ 22,00
  83.    @ 22,22 SAY "Enter Disk File Name"
  84.    @ 22,44 GET filename PICTURE '!!!!!!!!'
  85.    @ 22,54 SAY "(.TXT will be added )"
  86.    READ
  87.    STOR 'C' TO dr
  88.    @ 22,00
  89.    @ 22,22 SAY 'Select drive to put Files on  ' GET dr PICTURE '!'
  90.    READ
  91.    DO WHIL AT(dr,'ABC') = 0
  92.     @ 22,00
  93.     @ 22,22 SAY 'Select drive to put Files on  ' GET dr PICTURE '!'
  94.     READ
  95.    ENDD while @
  96.   ENDI disk = Y
  97.   IF disk = 'Y' .AND. filename <> ' '
  98.    STOR AT('.',filename) TO length
  99.    IF length = 0 .OR. length > 8
  100.     STOR 9 TO length
  101.    ENDI length
  102.    STOR SUBSTR(filename,1,length-1) TO filename
  103.    STOR '&dr.:'+filename+'.TXT' TO filename
  104.    SET ALTERNATE TO &filename
  105.   ENDI disk = Y and filename <> ''
  106.  ENDI disk = Y
  107.  CLEA
  108.  DO CASE
  109.  CASE comman1 = 'A'
  110.   DO list
  111.  CASE comman1 = 'B'
  112.   DO list1
  113.  CASE comman1 = 'C'
  114.   DO phone
  115.  CASE comman1 = 'D'
  116.   DO compact
  117.  CASE comman1 = 'E'
  118.   DO onelab
  119.  CASE comman1 = 'F'
  120.   DO special
  121.  CASE comman1 = 'H'
  122.   DO wsfile
  123.  CASE comman1 = 'I'
  124.   DO wsfile1
  125.  CASE comman1 = 'G'
  126. * display the records
  127.   CLEA
  128.   @ 02,02 SAY 'Records are displayed by Last names. You may choose the first letter'
  129.   @ 03,02 SAY 'of the starting location of the records.'
  130.   SET ESCAPE OFF
  131. * get a starting point in file
  132.   STOR SPACE(8) TO stletter
  133.   @ 5,02 SAY 'Starting point for the display (up to 8 letters)'
  134.   @ 5,60 Get stletter PICTURE '!!!!!!!!'
  135.   READ
  136. * goto starting point or next if no find
  137.   SEEK stletter
  138.   STOR TRIM(stletter) TO stletter
  139.   SEEK stletter
  140.   IF .NOT. found()
  141.    GO top
  142.   ENDI .NOT. found
  143.   CLEA
  144.   SET ESCAPE OFF
  145.   STOR .t. TO more10
  146.   i = inkey()
  147.   DO WHILE more10
  148.   DISP NEXT 15 lastname, fname, spouse, cs1
  149.   @ 22,10 SAY "Hit 'Q' to quit - any other key to continue"
  150.   SET CONSOL OFF
  151.   WAIT to i
  152.   IF i = 'Q' .OR. i = 'q' .OR. EOF() .OR. BOF()
  153.   STORE .f. TO more10
  154.   ENDIF
  155.   SET CONSOL ON
  156.   CLEAR
  157.   ENDDO
  158.   SET ESCAPE ON
  159.  CASE comman1 = '?'
  160.   CLEA
  161.   TEXT
  162.  
  163.  
  164.                       R E P O R T    M E N U   H E L P 
  165.  
  166.        This program prepares a number of reports from the mailing  list data in
  167.        addition to preparing WordStar Mailmerge files which you can use to send
  168.        personalized letters.                        
  169.  
  170.        The Mailmerge options create two files. One is a '.DAT'  file which con-
  171.        tains the names and addresses that WordStar will use to personalize  the
  172.        letter or document you have prepared.    The other file is a '.TXT' file
  173.        which has the introductory information you need to prepare the letter or
  174.        document which you are going to merge.
  175.  
  176.        It is preferable to prepare the draft letter as a separate WordStar doc-
  177.        ument.  When both it and your data base are finalized,  run the WordStar
  178.        option on this program and then after you exit the program open the .TXT
  179.        file as a 'D' file in WordStar and read in the text of your letter. This
  180.        text file will then become the basic merge file.
  181.  
  182.  
  183.                                    Please hit any key to continue..............
  184.   ENDT
  185.   SET CONSOLE OFF
  186.   WAIT
  187.   SET CONSOLE ON
  188.   CLEA
  189.  CASE comman1 = 'J' .OR. comman1 = 'Q'
  190.   STOR .f. TO more1
  191.  ENDC
  192.  SET PRINT OFF
  193.  SET ALTERNATE OFF
  194.  SET MARGIN TO 0
  195.  SET FILTER TO
  196.  GO TOP
  197. ENDD while more1
  198. STOR ' ' TO command
  199. STOR .t. TO first
  200. RETU
  201. 
  202.