home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / ipl / progs / adlfirst.icn < prev    next >
Text File  |  2000-07-29  |  1KB  |  46 lines

  1. ############################################################################
  2. #
  3. #    File:     adlfirst.icn
  4. #
  5. #    Subject:  Program to write first line of addresses
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     November 19, 1997
  10. #
  11. ############################################################################
  12. #
  13. #   This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #     This program writes the first lines of entries in an address list file.
  18. #  If an argument is given, it counts only those that have designators
  19. #  with characters in the argument. Otherwise, it counts all entries.
  20. #
  21. ############################################################################
  22. #
  23. #  See also: address.doc, adlcheck.icn, adlfiltr.icn, adllist.icn,
  24. #     adlsort,icn, labels.icn
  25. #
  26. ############################################################################
  27.  
  28. procedure main(arg)
  29.    local s, line
  30.  
  31.    s := cset(arg[1]) | &cset
  32.  
  33.    while line := read() do
  34.       line ? {
  35.          if any('#') & upto(s) then {
  36.             while line := read() | exit() do
  37.                if line[1] == ("*" | "#" ) then next
  38.                else {
  39.                   write(line)
  40.                   break
  41.                   }
  42.             }
  43.          }
  44.  
  45. end
  46.