<!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 - Calling Functions
</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="../cat+en">Up</a>&nbsp;
<a href="array+en">Previous</a>&nbsp;
<a href="class+en">Next</a>&nbsp;
</td></tr></table>
<div class="notab">
<h1>
Calling Functions
</h1>
<table class="table" border="0" bordercolor="#000000" cellpadding="4" cellspacing="0">
<tr class="dark"><td valign="top">
<tt><a href="../name/gb.call+en">GB.Call</a></tt>
</td><td valign="top">
Calls a function.
</td></tr>
<tr><td valign="top">
<tt><a href="../name/gb_function+en">GB_FUNCTION</a></tt>
</td><td valign="top">
Datatype representing a pointer to a function.
</td></tr>
<tr class="dark"><td valign="top">
<tt><a href="../name/gb.getfunction+en">GB.GetFunction</a></tt>
</td><td valign="top">
Retrieves a function.
</td></tr>
<tr><td valign="top">
<tt><a href="../name/gb.push+en">GB.Push</a></tt>
</td><td valign="top">
Pushes some arguments on the interpreter stack.
</td></tr>
</table>
<p>
<h2>Overview</h2>
<p>
These functions allows you to call any public function of any class
from a component. This function can be native, or written in <a href="../../def/gambas+en">Gambas</a>.
<p>
First, you must use <tt><a href="../name/gb.getfunction+en">GB.GetFunction</a></tt> to retrieve sort of a function
pointer from the name of the function and the class it is declared in.
<p>
Then, you call the function by first pushing arguments on the
interpreter stack with <tt><a href="../name/gb.push+en">GB.Push</a></tt>, and then effectively
executing the function with <tt><a href="../name/gb.call+en">GB.Call</a></tt>.

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

