[Turn on line numbering]arg objs, str; var obj, found, l, f; found = []; for obj in (objs) { if (type(obj) == 'frob && !valid(frob_class(obj))) throw(~badfrob, "Bad Thing Frob", obj); else if (obj.match_name(str)) found += [obj]; } if (listlen(found) == 1) return found[1]; if (listlen(found) > 1) { if ((f = filter f in (found) where (f.name() == str))) { if (listlen(f) == 1) return f[1]; found = f; } throw(~ambig, "ambiguous match", found); } throw(~objnf, "Object not found.");
// Created 27-Mar-1995 as a part of ColdCore, see: @help Credit