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 / pbkdump.icn < prev    next >
Text File  |  2000-07-29  |  1KB  |  48 lines

  1. ############################################################################
  2. #
  3. #    File:     pbkdump.icn
  4. #
  5. #    Subject:  Program to dump HP95 phone book file
  6. #
  7. #    Author:   Robert J. Alexander
  8. #
  9. #    Date:     August 14, 1996
  10. #
  11. ############################################################################
  12. #
  13. #   This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  Program to dump data from a HP95 phone book (pbk) file.
  18. #
  19. ############################################################################
  20. #
  21. #  Links: pbkform, bkutil
  22. #
  23. ############################################################################
  24. #
  25. #  See also: pbkform.icn, pbkutil.icn, abkform.icn
  26. #
  27. ############################################################################
  28.  
  29. link pbkform,bkutil
  30.  
  31. procedure main(args)
  32.    local fn, f, x
  33.  
  34.    every fn := !args do {
  35.       f := open(fn,"u") | stop("Can't open ",fn)
  36.       x := pbk_read_id(f)
  37.       while x := pbk_read_data(f) do {
  38.      write("Name:   ",x.name)
  39.      write("Number: ",x.number)
  40.      write("Address:")
  41.      every write(!bk_format_lines(x.address))
  42.      write()
  43.      }
  44.       pbk_read_end(f) | write("Fail on end record")
  45.       close(f)
  46.       }
  47. end
  48.