# In / Out Variables

In and Out variables are a way to pass config or input data into the pattern and read result data back out from the pattern.

Each `in` and `out` variable creates an entry in the Settings tab of the Pattern Editor view. `in` variables create an input field, `out` variables create a label.

Before executing the pattern, the user can now enter a value in the input field of the `in` variable. This value will be copied into the corresponding `in` variable before the pattern is executed.

Likewise, once the pattern has finished executing, whatever value has been written to the `out` variable will be displayed in the label.

The following code shows a simple pattern that reads in the value of `inputValue`, multiplies it by two and then writes it back into `outputValue`.

```rust
u32 inputValue in;
u32 outputValue out;

fn main() {
    outputValue = inputValue * 2;
};
```

<figure><img src="/files/xor6jvSYkW6XlHih66bA" alt=""><figcaption></figcaption></figure>


---

# 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://docs.werwolv.net/pattern-language/core-language/in-out-variables.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.
