View/Edit #12:@set-note-string @set-note-text @set-note-value

Switch to edit mode.

Name(s): @set-note-string @set-note-text @set-note-value
1:  "Usage:  @set-note-{string | text} {#xx | #xx.pname}"
2:  "        ...lines of text..."
3:  "        ."
4:  ""
5:  "For use by clients' local editors, to save new text for a note or object property.  See $note_editor:local_editing_info() for details."
6:  set_task_perms(player)
7:  text = $command_utils:read_lines(1)
8:  if (verb == "@set-note-string" && length(text) <= 1)
9:    text = text ? text[1] | ""
10: endif
11: isfile = !!index(argstr, "!")
12: if (spec = $code_utils:("parse_" + (isfile ? "file" | "prop") + "ref")(argstr))
13:   o = toobj(spec[1])
14:   p = spec[2]
15:   if (isfile)
16:     try
17:       e = o:filewrite(p, text)
18:       if (o:fileread(p) != text)
19:         player:tell("Error: ", e)
20:       else
21:         player:tell("Set ", p, " file of ", o:nn(), ".")
22:       endif
23:     except r (ANY)
24:       player:tell("Error: ", r)
25:     endtry
26:   else
27:     if (verb == "@set-note-value")
28:       text = $su:to_value(text[1])
29:       if (text[1])
30:         text = text[2]
31:       else
32:         return player:tell("Error: ", text[2])
33:       endif
34:     endif
35:     e = o:("_set_" + p)(text)
36:     if (e != text)
37:       player:tell("Error: ", e)
38:     else
39:       player:tell("Set ", p, " property of ", o.name, " (", o, ").")
40:     endif
41:   endif
42: elseif (typeof(note = $code_utils:toobj(argstr)) == $OBJ)
43:   try
44:     note:set_text(text)
45:   except e (ANY)
46:     return player:tell("Error: ", e)
47:   endtry
48:   player:tell("Set text of ", note.name, " (", note, ").")
49: else
50:   player:tell("Error: Malformed argument to ", verb, ": ", argstr)
51: endif
52: "Last modified by Dax (#789) on Tue May  3 13:47:06 2005 MDT."

Verb arguments: any none none
Verb perms: Readable NOT-Debug
Verb owned by: Slacker (#55)

You are not logged in.

[home | help | who | search | setup | code]