/
ColdC/Functions/
ColdC/Structure/
<head><title>ColdC: Objects: Messages and Methods</title></head>

<body>
<h1 align=center><a href="/ColdC/">ColdC</a>: <a href="/ColdC/Objects/">Objects</a>: Methods</h1>

<hr>

<p>A method is a series of ColdC statements which are grouped together as
a procedure, to perform a task.  Method's are given a name, and bound to
a specific object.  Methods determine the object's behavior.</p>

<p>Methods have a specific structure to them.  The number of arguments they
will accept is defined at the beginning of the method, followed by the
definition all of the variables used within the method.  Subsequent lines
compose the actual method.  <a href="/ColdC/methods.html">More on method
structure</a> is available later in this manual.</p>

<p>When <i><a href="/ColdC/oop.html">descendants</a></i> of an object wish
to change their behavior, they may define their own methods, or <i>override</i>
a method defined on an <i>ancestor</i>.  A method is overriden by simply
naming it the same as an existing method on an ancestor of the object.  When
a method is called, the interpreter looks for it first on the object, then
on the object's ancestors.  It is possible for a method overriding another
to stop executing and pass back to the method on it's ancestor, and then
resume executing when the overriden method is completed.</p>

<p>It is possible for a method to disallow descendants to override a method,
See <a href="/ColdC/methods.html">Defining Methods</a>.

<hr size=4><p align=center><i>Last Modified on Jan 25 1996</i>
<br><i>Copyright &copy; 1995, 1996, Brandon Gillespie</i>
</body>