Method code for $builder._ar__get_group()

[Turn on line numbering]
arg args, opts, @notall;
var group, groups, s, menu;

groups = $argroup.children();
if (opts) {
    if ("a?ll" in opts.slice(1) && !notall)
        group = 'All;
    else if (!(group = (| groups.match_object(opts[1][2]) |)))
        throw(~stop, "Invalid AR Group '" + opts[1][2] + "'");
} else {
    if (notall)
        menu = [];
    else
        menu = ["0=>ALL GROUPS"];
    for group in [1 .. listlen(groups)]
        menu += [group + "=>" + groups[group].name()];
    group = 0;
    menu += ["X=>Exit"];
    while (1) {
        s = (> .do_menu("AR Groups", "Select AR Group", @menu) <);
        if (!s || s == "X")
            return 0;
        if (s.is_numeric()) {
            if (!(group = (| groups[toint(s)] |)) && s == "0") {
                if (!notall)
                    group = 'All;
                group = 0;
            }
        }
        if (!group)
            .tell(["**", "** Sorry, '" + s + "' is not a valid group."]);
        else
            break;
    }
}
return group;

// $#Edited: 27 Aug 01 16:11 $user_lynx

["// Created 26-Mar-1995 as a part of ColdCore, see: @help Credit"]

the Cold Dark