Method code for $has_text.ins_line()

[Turn off line numbering]
  1: arg txt, @loc;
  2: var t;
  3: 
  4: // inserts txt at loc (where loc is an integer)
  5: if (!.is_writable_by(sender()) && sender() != this())
  6:     throw(~perm, "Permission Denied.");
  7: [(loc ?= 0)] = loc;
  8: t = .get_raw_text();
  9: if (!loc)
 10:     t += [txt];
 11: else
 12:     t = (> t.insert(loc, txt) <);
 13: .set_text(t);

// Created 27-Mar-1995 as a part of ColdCore, see: @help Credit

Tlon