<topic template="Default" lasteditedby="Georg Kiehne" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../helpproject.xsd" status="Needs Review">
  <title translate="true">Procedures and Functions</title>
  <body>
    <header>
      <para styleclass="Heading1"><text styleclass="Heading1" translate="true">Procedures and Functions</text></para>
    </header>
    <para styleclass="Normal"><table styleclass="Default" rowcount="1" colcount="1" style="width:654px;">
      <tr style="vertical-align:top">
        <td style="width:642px;">
          <para styleclass="Normal"><text styleclass="Normal" translate="true">Apophysis script supports the definition of own sub-programs with either no return value (procedures) or with a return value. (functions) You may define those as following:</text></para>
          <para styleclass="Normal"></para>
          <para styleclass="Code Example"><text styleclass="Code Example" translate="true">procedure DoSomething;</text></para>
          <para styleclass="Code Example"><text styleclass="Code Example" translate="true">begin</text></para>
          <para styleclass="Code Example"><text styleclass="Code Example" translate="true">  // your code here</text></para>
          <para styleclass="Code Example"><text styleclass="Code Example" translate="true">end;</text></para>
          <para styleclass="Code Example"></para>
          <para styleclass="Code Example"><text styleclass="Code Example" translate="true">function GetSomething;</text></para>
          <para styleclass="Code Example"><text styleclass="Code Example" translate="true">begin</text></para>
          <para styleclass="Code Example"><text styleclass="Code Example" translate="true">  // the variable &quot;result&quot; is auto-defined in functions</text></para>
          <para styleclass="Code Example"><text styleclass="Code Example" translate="true">  Result := 0;</text></para>
          <para styleclass="Code Example"><text styleclass="Code Example" translate="true">end;</text></para>
        </td>
      </tr>
    </table></para>
    <para styleclass="Normal"></para>
    <para styleclass="Image Caption"><text styleclass="Image Caption" translate="true">Jump to: </text><link displaytype="text" defaultstyle="true" type="topiclink" href="Identifiers" styleclass="Image Caption" translate="true">Identifiers</link><text styleclass="Image Caption" translate="true"> - </text><link displaytype="text" defaultstyle="true" type="topiclink" href="Literals_and_operators" styleclass="Image Caption" translate="true">Literals and Operators</link><text styleclass="Image Caption" translate="true"> - </text><link displaytype="text" defaultstyle="true" type="topiclink" href="Conditions_and_Loops" styleclass="Image Caption" translate="true">Conditions and Loops</link><text styleclass="Image Caption" translate="true"> - </text><link displaytype="text" defaultstyle="true" type="topiclink" href="Procedures_and_functions" styleclass="Image Caption" translate="true">Procedures and Functions</link><text styleclass="Image Caption" translate="true"> - </text><link displaytype="text" defaultstyle="true" type="topiclink" href="Comments" styleclass="Image Caption" translate="true">Comments</link></para>
  </body>
</topic>
