methods

coolmud/doc/methods · 574 B

From the archive coolmud-2.2.1-r8.zip

Download the archive   « Back to the archive contents

Declaring Methods

Methods consist of a "method" declaration, variable and error handling
declarations, statements, and an "endmethod" declaration.

The simplest method of all is the null method:

	method foo
	endmethod

Methods describe the action to be taken when an object receives a certain
method.  If a message is sent to an object for which it does not have a
corresponding method, E_METHODNF is raised.  Methods may be called by
any other object, so any permissions checking must be done by the
method itself.

	method add
	    return args[1] + args[2];
	endmethod

Site Stats

Snippets: 1791
Codebases: 571