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

  1. ############################################################################
  2. #
  3. #    Name:    title.icn
  4. #
  5. #    Title:    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.