home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / OL.LZH / PROCS.LZH / NAMEPFX.ICN < prev    next >
Text File  |  1991-09-05  |  1KB  |  43 lines

  1. ############################################################################
  2. #
  3. #    Name:    namepfx.icn
  4. #
  5. #    Title:    Produce prefix portion of name
  6. #
  7. #    Author:    Ralph E. Griswold
  8. #
  9. #    Date:    September 2, 1991
  10. #
  11. ############################################################################
  12. #
  13. #  Produces the "name prefix" from a name in standard form -- omitting
  14. #  any title, but picking up the first name and any initials.
  15. #
  16. #  There are a lot more titles that should be added to this list.
  17. #
  18. #  Obviously, it can't always produce the "correct" result.
  19. #
  20. ############################################################################
  21. #
  22. #  Links:  lastname, titleset
  23. #
  24. ############################################################################
  25.  
  26. link lastname, titleset
  27.  
  28. procedure namepfx(s)
  29.    static titles
  30.  
  31.    initial titles := titleset()
  32.  
  33.    s ?:= {                # Get past title
  34.       while =!titles do tab(many(' '))    # "Professor Doctor ... "
  35.       tab(0)
  36.       }
  37.  
  38.    s ?:= trim(tab(find(lastname(s))))
  39.  
  40.    return s
  41.  
  42. end
  43.