@verb #24:"set_output" this none this rxdo #789
@program #24:"set_output" this none this
caller == this || raise(E_PERM)
{pagelength, linelength, wrap, accent, rend} = args
pagelength = toint(pagelength)
linelength = toint(linelength)
wrap in {"off", "no", "0", 0} && (wrap = 0)
wrap in {"on", "yes", "1", 1} && (wrap = 1)
accent = tostr(accent)
text = {}
if (pagelength != this.output_more_pagelength)
if (pagelength < 10 && pagelength != 0)
text = {@text, tostr("You probably want a larger pagelength than ", pagelength, ", no?")}
else
this.output_more_pagelength = pagelength
text = {@text, "Pagelength set!"}
endif
endif
if (linelength != this.output_linelength)
if (linelength < 10)
text = {@text, tostr("You probably want a larger linelength than ", linelength, ", no?")}
else
this.output_linelength = linelength
text = {@text, "linelength set!"}
endif
endif
if (wrap != this.output_wrap)
if (wrap != 0 && wrap != 1)
raise(E_INVARG, "Wrap must be either 1 or 0.", wrap)
else
this.default_output_wrap = this.output_wrap = wrap
text = {@text, "Wrap set!"}
endif
endif
if (accent != this.output_accent_mode)
if (!(accent in {"html", "stripped", "iso", "dos", "utf8"}))
text = {@text, tostr("Accents must be one of: HTML, Stripped, ISO, DOS, UTF8")}
else
this.default_accent_mode = this.output_accent_mode = $su:uppercase(accent)
text = {@text, "Accents set!"}
endif
endif
if (rend != this.output_rendering_object)
fl = 1
if ((rend = $code_utils:toobj(argstr)) == E_TYPE)
fl = 0
for rend in ($render:descendants())
if (typeof(abbr = rend:abbrev()) == $LIST ? argstr in abbr | argstr == abbr)
fl = 1
break
endif
endfor
endif
if (!fl || !rend:isa($render))
text = {@text, "That's not a valid rendering object."}
rend = this.output_rendering_object
else
this.default_rendering_object = this.output_rendering_object = rend
text = {@text, "Renderer Set!"}
endif
endif
text = {@text, "^ Current output settings:"}
text = {@text, tostr("| @pagelength ", this.output_more_pagelength)}
text = {@text, tostr("| @linelength ", this.output_linelength)}
text = {@text, tostr("| @wrap ", this.output_wrap ? "on" | "off")}
text = {@text, tostr("| @accents ", this.output_accent_mode, " (eg. áÊïòç)")}
text = {@text, tostr("| @renderer ", @rend:abbr() ? {{@rend:abbr()}[1], " [", rend:title(), "]"} | {rend, " [", rend:title(), "]"})}
text[$] = tostr(text[$], " (eg. red, bold, italic)")
text = {@text, tostr("+", $su:space(this.output_linelength - 2, "-"), ">")}
return text
"Last modified by Dax (#789) on Tue May 3 13:55:52 2005 MDT."
.