# Textual programming

The text-based programming mode allows you to edit the program [generated](/en/studio/programming-code.md#generation) from the diagram before downloading it to the robot or [write the program](/en/studio/programming-code.md#new-programm) in text form from scratch.

## Create a new text program <a href="#new-programm" id="new-programm"></a>

1\. Create a diagram containing the "Initial Node" and "Final Node" blocks.

2\. Select a real robot mode.

3\. Click on the “Generate Code” button.\
\
After that, an empty program template that contains all the necessary declarations will appear.

![](/files/-MUQUlOfk1-Cj-db4R5M)

## Generate code from the diagram <a href="#generation" id="generation"></a>

1\. Select the real robot mode.

2\. Press the "Generate code" button.

{% hint style="info" %}
When the diagram is regenerated, manual changes will not be lost if the text file is saved. The result of the new generation will be saved to another file.
{% endhint %}

![](/files/-MUQUswIVEPJuL68gRBx)

## Supported programming languages

The supported text programming language is platform-dependent. One platform can have multiple target text languages.

{% hint style="warning" %}
**Attention!** Available generators depend on the installed plug-ins.
{% endhint %}

### TRIK controller <a href="#trik" id="trik"></a>

For the TRIK platform, generation is possible in:

* [Python](/en/trik/programming-code.md).
* [JavaScript](/en/trik/programming-code.md).

### Lego EV3 controller <a href="#ev3" id="ev3"></a>

Experts in EV3 can look at the code generated in the internal language of EV3 using the "Generate into EV3 byte code" button. Theoretically, it can be edited and run for execution or even used for EV3 text programming, but it is inconvenient to do this - the language was created to automatically generate, rather than write programs.

### Lego NXT controller <a href="#nxt" id="nxt"></a>

For Lego NXT, generation in [C language](/en/nxt/c.md) is supported using the ECRobot library.

### Geoscan Pioneer quadcopter <a href="#peoneer" id="peoneer"></a>

For the quadcopter Geoscan Pioneer, generation in Lua is possible.


---

# 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/studio/programming-code.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.
