@verb #51:"s*ubst" any any any rxdo #60 @program #51:"s*ubst" any any any "Copied from Generic Editor (#51):subst by Hacker (#60)Jun 27 06:49:18 2001" if (callers() && caller != this) raise(E_PERM) endif if (!this.escape_XML) argstr = player:input_get_raw(argstr) endif if (!(who = this:loaded(player))) player:tell(this:msg_nothing_loaded()) elseif (typeof(subst = this:parse_subst(argstr)) != $LIST) player:tell(tostr(subst)) elseif (typeof(range = this:parse_range(who, {"_", "1"}, @$string_utils:explode(subst[4]))) != $LIST) player:tell(range) elseif (range[3]) player:tell("Junk at end of cmd: ", range[3]) else fromstr = subst[1] tostr = subst[2] global = index(subst[3], "g", 1) case = !index(subst[3], "c", 1) munged = {} text = this.texts[who] changed = {} for line in [from = range[1]..to = range[2]] t = t0 = text[line] if (!fromstr) t = tostr + t elseif (global) t = strsub(t, fromstr, tostr, case) elseif (i = index(t, fromstr, case)) t = t[1..i - 1] + tostr + t[i + length(fromstr)..length(t)] endif if (strcmp(t0, t)) changed = {@changed, line} endif munged = {@munged, t} endfor if (!changed) player:tell("No changes in line", from == to ? tostr(" ", from) | tostr("s ", from, "-", to), ".") else this.texts[who] = {@text[1..from - 1], @munged, @text[to + 1..length(text)]} this.changes[who] = text this.times[who] = time() for line in (changed) this:list_line(who, line) endfor endif endif "Last modified by Dax (#789) on Wed May 4 06:46:00 2005 MDT." .