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

  1. **    Last revision: April 17, 1986 at 18:54
  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. DO WHIL more2
  31. * do page counter etc
  32.  STOR pageno + 1 TO pageno
  33.  STOR 6 TO lineno
  34.  CLEAR
  35. * eject a page and skip down 1 line
  36. IF printer = 'Y'
  37.  SET PRINT ON
  38.  EJEC
  39. ENDIF
  40.  ? '  '
  41. * and write TITLE
  42.  ? '==========================   MAILING LIST   ======================'
  43.  ? ' '
  44.  ? '         ' + DTOC(date()) + '                                           PAGE: '+ STR(pageno,3)
  45.  ? ' '
  46. * now fill up rest of page to 55 lines with names etc
  47.  DO WHIL lineno < 55
  48. * now do a page if not end of file
  49.   IF .NOT. EOF()
  50.    ? '-------------------------------------------------------------------'
  51.    STOR lastname TO lname
  52.    IF ASC(lastname) <= finish
  53.     ? '     ' +  "Name: "+ TRIM(mr)+' ' + TRIM(fname) +' ' + lastname
  54.     ? '     ' + "Spouse: " + spouse + "Address as: " + dear
  55.     ? '     ' + "Title: " + title
  56.     ? '     ' + "Company: " + company1
  57.     ? '     ' + "       : " + company2
  58.     ? '     ' + "Address: " + TRIM(caddress) + "  " + suite
  59.     ? '     ' + "         " + TRIM(ccity) +'  ' + cst + '  ' +czip
  60.     ? '     ' + "Home address: " + TRIM(address) + "  " + apt
  61.     ? '     ' + "              " + TRIM(city) +'  '+  st + '  ' +zip
  62.     ? '     ' + 'Phones - office: ' + ophone + ' home: ' + phone
  63.     ? '     ' + "List:  " + cs1  + "     Code: " + cs2
  64.     ? '     ' + "Send to office: " + send
  65.     ? '     ' + "Date update: " + update
  66.     STOR lineno +13 TO lineno
  67.     SKIP
  68. * if deleted, skip again
  69.     IF DELETE()
  70.      SKIP
  71.     ENDI
  72.    ELSE
  73.     STOR .f. TO more2
  74.     STOR 60 TO lineno
  75.    ENDI RANK(lname)
  76.   ELSE
  77.    STOR .f. TO more2
  78.    STOR 60 TO lineno
  79.   ENDI .NOT. EOF
  80.  ENDD while lineno < 55
  81. ENDD more2
  82. * if it was on turn it off
  83. IF printer = 'Y'
  84. EJEC
  85. ENDIF
  86. SET MARGIN TO 0
  87. SET PRINT OFF
  88. SET ALTERNATE OFF
  89. SET MARGIN TO 0
  90. RETURN
  91.  
  92.  
  93.