diff options
Diffstat (limited to 'noao/onedspec/ecidentify/ecprevious.x')
-rw-r--r-- | noao/onedspec/ecidentify/ecprevious.x | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/noao/onedspec/ecidentify/ecprevious.x b/noao/onedspec/ecidentify/ecprevious.x new file mode 100644 index 00000000..4301b722 --- /dev/null +++ b/noao/onedspec/ecidentify/ecprevious.x @@ -0,0 +1,23 @@ +include "ecidentify.h" + +# EC_PREVIOUS -- Return the previous feature. + +int procedure ec_previous (ec, feature) + +pointer ec # ID pointer +int feature # Starting feature (input), previous feature (returned) + +int i + +begin + for (i=feature-1; i>0; i=i-1) + if (APN(ec,i) == EC_AP(ec)) + break + + if (i > 0) + feature = i + else + i = EOF + + return (i) +end |