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

  1. ############################################################################
  2. #
  3. #    Name:    lastname.icn
  4. #
  5. #    Title:    Produce last name
  6. #
  7. #    Author:    Ralph E. Griswold
  8. #
  9. #    Date:    September 2, 1991
  10. #
  11. ############################################################################
  12. #
  13. #  Produces the last name of a name in conventional form.  Obviously, it
  14. #  doesn't work for every possibility.
  15. #
  16. ############################################################################
  17.  
  18. procedure lastname(s)
  19.    while line := trim(s) do {
  20.       line ?:= tab(upto(','))        # Get rid of things like " ... , Jr."
  21.       line ? {
  22.           every i := upto(' ')
  23.           tab(\i + 1)
  24.           return tab(0)
  25.           }
  26.       }
  27. end
  28.