aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/lib/pttables/ptkid.x
blob: 8b4aafcba9faf63728e6f13a0089e270d131f569 (plain) (blame)
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
# PT_KID -- Decode a column specification into a name and an element.

procedure pt_kid (column, name, element)

char	column[ARB]	# column name
char	name[ARB]	# column name
int	element		# column element

char	left_bracket
int	index
int	stridx(), ctoi()
data	left_bracket /'['/

begin
	# Get the proper name in upper case and strip off and subscript.
	call strcpy (column, name, SZ_FNAME)
	call strupr (name)
	index = stridx (left_bracket, name)
	if (index > 0) {
	    name[index] = EOS
	    index = index + 1
	    if (ctoi (column, index, element) < 0)
		element = 1
	} else
	    element = 1
end