> For the complete documentation index, see [llms.txt](https://docs.shrinefox.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shrinefox.com/flowscript/flowscript/variables-and-procedures.md).

# Variables

int number = 1;

**Variables** are named objects of a specified data type that we can assign a value to.

## Usage

### Declaring Variables

**Declaring** (or **defining**) a *variable* means giving it a name. \
You can declare a *variable* this way:

```csharp
var variableName;
```

### **Initializing Variables**

**Initializing** a *variable* means giving it an initial value.\
We can do just that with the `=` sign:

```csharp
var variableName = 25;
```

### Data Types

Each variable has a **Data Type** (also known as a **primitive**), such as...

| Name        | Description                                                                          | Example Value                                    |
| ----------- | ------------------------------------------------------------------------------------ | ------------------------------------------------ |
| `var`       | Default data type. The compiler will assume the most likely data type.               | <p>5</p><p>20.3<strong>f</strong></p><p>true</p> |
| **`int`**   | Integer. A whole number **between**  **-2147483648** and  **2147483647.**            | 24                                               |
| **`float`** | Floating-point. A decimal between **1.175494351 E - 38** and **3.402823466 E + 38**. | 24.01**f**                                       |
| **`bool`**  | Boolean. A **true** or **false** value. Can also be represented by 1 or 0.           | <p>true</p><p>1</p>                              |

You can initialize a *variable* with a specific data type if you want:

```csharp
int variableName = 25;
float variableName2 = 25.01;
```

In most cases, the compiler will assume a number is an `int`. \
You can put an **`f`** after any number to show that it's a `float`, even without a decimal point:

```csharp
// This will be assumed to be an int
var variableName = 25;
// This will be assumed to be a float
var variableName2 = 25f;
```

## Conclusion

Now you know how to save whole numbers, decimals, and true/false values and refer to them by name. This will be very useful for re-using values in mathematic expressions and [**procedures**](/flowscript/flowscript/procedures.md).

With that in mind, you're ready to learn about a major component of [procedures](/flowscript/flowscript/procedures.md) and *variables*.

{% content-ref url="/pages/-MhWua76OOvIT7f52pcA" %}
[Scope](/flowscript/flowscript/scope.md)
{% endcontent-ref %}
