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

  1. ############################################################################
  2. #
  3. #    File:     title.icn
  4. #
  5. #    Subject:  Procedure to produce title portion of name
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     September 2, 1991
  10. #
  11. ###########################################################################
  12. #
  13. #    This procedure produces the "title" of a name, as "Mr." from
  14. #  "Mr. John Doe".
  15. #
  16. #    The processs is imperfect.
  17. #
  18. ############################################################################
  19. #
  20. #  Links:  titleset
  21. #
  22. ############################################################################
  23.  
  24. link titleset
  25.  
  26. procedure title(name)
  27.    local result
  28.    static titles
  29.  
  30.    initial titles := titleset()
  31.  
  32.    result := ""
  33.  
  34.    name ? {
  35.       while result ||:= =!titles || " " do
  36.         tab(many(' \t'))
  37.       return result ? tab(-1 | 0)
  38.       }
  39.  
  40. end
  41.