Manual:DIL Manual/dilend

From DikuMUD Wiki
Jump to navigation Jump to search

dilend

Keyword. Ends a template.

dilbegin name();
...
code
{
   ...
}
dilend

Every dilbegin needs its dilend, right after the closing brace of code. A comment may follow it on the same line.

Notes

  • dilend works through a macro: wmacros.h defines it as dilend^, and vmc takes each program out of the zone from dilbegin up to the first ^. A zone with DIL therefore has to #include <macros.h> (which includes wmacros.h).
  • Because of that, a ^ anywhere in a program's text, for instance inside a string, ends the program there and gives a syntax error. Comments are removed before this happens, so a ^ in a comment does no harm.
  • A missing dilend makes vmc read on into whatever follows, and fail there.

Example

dilbegin bell();
code
{
   act("A bell rings; its note hangs in the air.", A_ALWAYS, self, null, null, TO_ALL);
   quit;
}
dilend // the end of bell

The smallest kind of program: a header, a code section and dilend.

See also