diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /noao/digiphot/lib/pttables/ptkid.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'noao/digiphot/lib/pttables/ptkid.x')
-rw-r--r-- | noao/digiphot/lib/pttables/ptkid.x | 26 |
1 files changed, 26 insertions, 0 deletions
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 |