[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.1.5 The .program Command

The .program command is a common way for programmers to associate a particular MOO-code program with a particular verb. It has the following syntax:

 
.program object:verb
 ...lines of MOO code...
.

That is, after typing the .program command, then all lines of input from the player are considered to be a part of the MOO program being defined. This ends as soon as the player types a line containing only a dot (`.'). When that line is received, the accumulated MOO program is checked for proper MOO syntax and, if correct, associated with the named verb.

Fine point: The lines are entered verbatim; no "dot-unquoting" is performed. That is, the translation often performed in other similar contexts (e.g., LambdaCore's $prog:@program verb or other LambdaCore commands that make use of $command_utils:read_lines()) in which a line beginning with two dots (`..') will have the first dot stripped before being included, does not occur here.

If, at the time the line containing only a dot is processed, (a) the player is not a programmer, (b) the player does not have write permission on the named verb, or (c) the property $server_options.protect_set_verb_code exists and has a true value and the player is not a wizard, then an error message is printed and the named verb's program is not changed.

In the .program command, object may have one of three forms:


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Roger Crew on June, 2 2004 using texi2html