Method code for $list.match_nth()

[Turn on line numbering]
arg objs, str, nth;
var obj, n;

n = nth;
for obj in (objs) {
    if (obj.match_name(str)) {
        if (!--n)
            return obj;
    }
}
throw(~match, "There are not " + (.numbers())[nth] + " " + str + "'s available.");

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

Tlon