home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / BIPL.ZIP / PROCS.ZIP / NAMEPFX.ICN < prev    next >
Encoding:
Text File  |  1992-09-28  |  1.0 KB  |  43 lines

  1. ############################################################################
  2. #
  3. #    File:     namepfx.icn
  4. #
  5. #    Subject:  Procedure to 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.