<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../style.css">
<title>
Gambas Documentation - BEGIN_METHOD
</title>
</head>
<table class="none" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left">
<font size="-1">
<a href="../../../help+en"><img class="flag" alt="Home" border="0" src="../../../img/lang/en.png" align="center"></a>&nbsp;
<a href="../name+en">Up</a>&nbsp;
<a href="arg+en">Previous</a>&nbsp;
<a href="begin_method_void+en">Next</a>&nbsp;
</td></tr></table>
<div class="notab">
<h1>
BEGIN_METHOD
</h1>
<div class="black"><font size="-2"><b>Syntax</b></font></div>
<pre class="syntax">#define <b>BEGIN_METHOD</b> ( <u>name</u> , <u>arguments</u> ) ...</pre><p>

Begins the implementation of a method.
<p>
<ul>
<li><u>name</u> is the name of the function, as specified in the class declaration.
<li><u>arguments</u> describes the arguments of the method.
<p>
</ul>

Be careful ! As the implementation function will receive its arguments as a pointer at the
interpreter stack, arguments is in fact the inside of a structure describing the stack contents.
<p>
Consequently:
<p>
<ul>
<li>Each argument must be one of the <a href="../cat/value+en">Gambas Value Datatype</a>.
<li>The arguments are separated by semicolons, and <b>NOT</b> commas.
<p>
</ul>

A method named foo declared this way :
<p>
<pre class="code">...
GB_METHOD("foo", NULL, "iisvbInteger[];d", do_foo),
...
</pre><p><p>
will be implemented this way :
<p>
<pre class="code">BEGIN_METHOD(do_foo,
  GB_INTEGER param1;
  GB_INTEGER param2;
  GB_STRING param3;
  GB_VARIANT param4;
  GB_BOOLEAN param5;
  GB_OBJECT param6;
  GB_DATE param7)

...

END_METHOD
</pre><p><p>
Note that semicolons delimitate arguments, and that the last argument has no semicolon at its end.
<p>
<hr><b>See also</b><br>
<a href="../cat/method+en">Methods Implementation</a>&nbsp;

</div>
</body>
</html>

