# Storage

Often you'll need to store some data with the purpose of accessing it later or in a different place, where it would be otherwise inaccessible or messy. In this section, you'll learn different ways to store that information, so you can choose the most optimal for your situation.

Each of these methods have their own uses, and can be better than others depending on the situation. That's why it's important to have all of these in your toolbox and understand what the differences between them are.

***

## Is this necessary?

Sometimes, it might not be necessary to store something; you might be able to access it through an expression.

Storing an object is akin to taking a snapshot of its value so you can use it:

* At a later time (after its value might have been modified)
* Elsewhere in the code (where it would be otherwise unaccessible)
* To clean-up code by setting it to a messy or long value (then you can use the variable instead of whatever it is set to)

Most other times, storing is not necessary, as you'll have an expression or event-value that is perfectly useable. Consider the following snippet:

{% code overflow="wrap" lineNumbers="true" %}

```python
on right-click on dirt:
  set {_player} to player
  set {_block} to event-block
  set {_block} to gold block
  send "You turned that dirt into gold with your golden touch!" to {_player}
```

{% endcode %}

Here, the local variables are useless, as you can just use the `player` and `event-block` event-values.


---

# 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://x8ight.gitbook.io/syntask/storage.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.
