From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- noao/digiphot/lib/pttables/ptkid.x | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 noao/digiphot/lib/pttables/ptkid.x (limited to 'noao/digiphot/lib/pttables/ptkid.x') diff --git a/noao/digiphot/lib/pttables/ptkid.x b/noao/digiphot/lib/pttables/ptkid.x new file mode 100644 index 00000000..8b4aafcb --- /dev/null +++ b/noao/digiphot/lib/pttables/ptkid.x @@ -0,0 +1,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 -- cgit