Method code for $list.match_nth()

[Turn off line numbering]
  1: arg objs, str, nth;
  2: var obj, n;
  3: 
  4: n = nth;
  5: for obj in (objs) {
  6:     if (obj.match_name(str)) {
  7:         if (!--n)
  8:             return obj;
  9:     }
 10: }
 11: throw(~match, "There are not " + (.numbers())[nth] + " " + str + "'s available.");

// Created 27-Mar-1995 as a part of ColdCore, see: @help Credit

Tlon