Method code for $object_lib.format_object()

[Turn on line numbering]
arg obj, chop;
var len, line, out, c, oname;

if (type(obj) == 'frob)
    return ["Frob " + obj.namef('ref)];
c = obj.created_on();
oname = obj.namef('xref);
if ((| obj.aliases() |))
    oname += " (" + obj.aliases().to_english() + ")";
out = ["Object:   " + oname, "Created:  " + (c ? ctime(c) : "(Before Time)"), "Quota:    " + obj.quota() + " bytes" + (obj.quota_exempt() ? " ** exempt **" : ""), "Perms:    " + obj.flags().prefix("+").join(), "Size:     " + obj.size().to_english() + " bytes (on disk)", "Manager:  " + .get_name(obj.manager(), 'namef, ['xref])];
line = obj.writers('literal);
if (line.length() != 1)
    line = "Writers:  " + line.to_english("(none)");
else
    line = "Writer:   " + line[1].namef('xref);
if (chop)
    line = line.chop(chop);
out += [line];
line = obj.trusted('literal) || [];
if (listlen(line)) {
    line = "Trusts:   " + line.to_english("(none)");
    if (chop)
        line = line.chop(chop);
    out += [line];
}
line = obj.parents();
if (line.length() > 1)
    line = "Parents:  " + line.mmap('namef, 'xref).to_english();
else if (!line)
    line = "Parents:  (none)";
else
    line = "Parent:   " + line[1].namef('xref);
if (chop)
    line = line.chop(chop);
out += [line];
if (obj.has_ancestor($located))
    out += ["Location: " + .get_name(obj.location(), 'namef, ['xref])];
if (obj.is($exit))
    out += ["Exit:     " + .get_name(obj.source(), 'namef, ['xref]) + " => " + .get_name(obj.dest(), 'namef, ['xref])];
return out;

// $#Edited: 07 Jun 03 12:51 $brandon
// $#Edited: 10 Jun 03 13:27 $user_brandon
// $#Edited: 10 Jun 03 14:25 $user_brandon

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

the Cold Dark