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

  1. **    Last revision: June 18, 1986 at 17:56
  2. * list.ag
  3. * this module makes a list of all information in the file
  4. * get a starting  and ending points in file
  5. STOR 'A' TO stletter
  6. @ 17,12 SAY 'Letter of alphabet at which to start report'
  7. @ 17,57 GET stletter PICTURE '!'
  8. READ
  9. STOR 'Z' TO llet
  10. @ 18,12 SAY 'Letter of alphabet at which to end report'
  11. @ 18,57 GET llet PICTURE '!'
  12. READ
  13. CLEA GETS
  14. STOR ASC(llet)+1 TO finish
  15. * goto starting point or next if no find
  16. IF stletter = 'A'
  17.  GO TOP
  18. ELSE
  19.  SEEK stletter
  20.  DO WHIL (EOF() .OR. BOF())
  21.   STOR ASC(stletter) + 1 TO start1
  22.   STOR CHR(start1) TO stletter
  23.   SEEK stletter
  24.  ENDD whil #
  25. ENDI stletter
  26. * initialize variables
  27. STOR 0 TO pageno
  28. STOR .t. TO more2
  29. SET MARGIN TO 10
  30. STOR 'Report of '+CMONTH(DATE())+' '+STR(DAY(DATE()),2)+", "+STR(YEAR(DATE()),4) TO mday
  31. DO WHIL more2
  32. * do page counter etc
  33.  STOR pageno + 1 TO pageno
  34.  STOR 6 TO lineno
  35.  CLEAR
  36. * eject a page and skip down 1 line
  37. IF printer = 'Y'
  38.  SET PRINT ON
  39.  EJEC
  40. ENDIF
  41.  ? '  '
  42. * and write TITLE
  43.  ? '==========================   MAILING LIST   ======================'
  44.  ? ' '
  45.  ? mday + '                              PAGE: '+ STR(pageno,3)
  46.  ? ' '
  47. * now fill up rest of page to 45 lines with names etc
  48.  DO WHIL lineno < 40
  49. * now do a page if not end of file
  50.   IF .NOT. EOF()
  51.    ? '-------------------------------------------------------------------'
  52.    STOR lastname TO lname
  53.    IF ASC(lastname) <= finish
  54.     ? '     ' + TRIM(mr)+' ' + TRIM(fname) +' ' + lastname 
  55.     STOR lineno+1 TO lineno
  56.     IF send = 'Y'
  57.     IF title <> '  '
  58.     ? '     ' + title
  59.     STOR lineno+1 TO lineno
  60.     ENDIF
  61.     IF company1 <> ' '
  62.     ? '     ' + company1
  63.     STOR lineno+1 TO lineno
  64.     ENDIF
  65.     IF company2 <> ' '
  66.     ? '     ' + company2
  67.     STOR lineno+1 TO lineno
  68.     ENDIF
  69.     ? '     ' + TRIM(caddress) + "  " + suite
  70.     ? '     ' + TRIM(ccity) +'  ' + cst + '  ' +czip
  71.     STOR lineno+2 TO lineno
  72.     ELSE
  73.     ? '     ' + TRIM(address) + "  " + apt
  74.     ? '     ' + TRIM(city) +'  '+  st + '  ' +zip
  75.     STOR lineno+2 TO lineno
  76.     ENDIF
  77.     ? '     ' + 'Phones - office: ' + ophone + ' home: ' + phone + ' List: '+cs1+' Code: '+cs2
  78.     SKIP
  79. * if deleted, skip again
  80.     IF DELETE()
  81.      SKIP
  82.     ENDI
  83.    ELSE
  84.     STOR .f. TO more2
  85.     STOR 60 TO lineno
  86.    ENDI RANK(lname)
  87.   ELSE
  88.    STOR .f. TO more2
  89.    STOR 60 TO lineno
  90.   ENDI .NOT. EOF
  91.  ENDD while lineno < 50
  92. ENDD more2
  93. * if it was on turn it off
  94. IF printer = 'Y'
  95. EJEC
  96. ENDIF
  97. SET PRINT OFF
  98. SET ALTERNATE OFF
  99. SET MARGIN TO 0
  100. RETURN
  101.  
  102.  
  103.  
  104.  
  105.