# Function include

{% hint style="info" %}
This article is automatically translated from Russian by Google Translator.
{% endhint %}

### Function description

Allows you to use functions implemented by the user in other files. It is supposed to write your own libraries.

As a passed parameter you must specify the full system path to the file with the required functions or the name of the file. In the second case, the file for a connection must be in the same directory as the main file in which `include` is called.

### Function call

{% tabs %}
{% tab title="other\_file.js" %}
{% code title="other\_file.js" %}

```javascript
// Functions must be declared as global variables
sum = function(a, b) {
    return a + b;
}
```

{% endcode %}
{% endtab %}

{% tab title="my\_file.js" %}

```javascript
include("other_file.js");
print(sum(1, 2));
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.trikset.com/en/trik/programming-code/function-include.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
