summaryrefslogtreecommitdiff
path: root/ipl/procs/namepfx.icn
blob: 43bc9ce11326b065c2ea13ccc7b18b8f25afcc12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
############################################################################
#
#	File:     namepfx.icn
#
#	Subject:  Procedure to produce prefix portion of name
#
#	Author:   Ralph E. Griswold
#
#	Date:     September 2, 1991
#
############################################################################
#
#   This file is in the public domain.
#
############################################################################
#
#  Produces the "name prefix" from a name in standard form -- omitting
#  any title, but picking up the first name and any initials.
#
#  There are a lot more titles that should be added to this list.
#
#  Obviously, it can't always produce the "correct" result.
#
############################################################################
#
#  Links:  lastname, titleset
#
############################################################################

link lastname, titleset

procedure namepfx(s)
   static titles

   initial titles := titleset()

   s ?:= {				# Get past title
      while =!titles do tab(many(' '))	# "Professor Doctor ... "
      tab(0)
      }

   s ?:= trim(tab(find(lastname(s))))

   return s

end