# For Loop

## Overview

![The For Loop Node.](https://2561100106-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ff6JZovzOqBctA4C1o76u%2Fuploads%2Fgit-blob-73bfe8580c59fa2c64f677914f63dacc70f07918%2Fforloopupdatedimage.png?alt=media)

The **For Loop Node** triggers an iterative process that steps through the provided **Int** inputs. The output can then, for example, be printed to the **Console** or affect the next **Node** in the **Logic Branch**.

[**Scope**](https://docs.incari.com/incari-studio/2023.2/overview#scopes): **Project**, **Scene**, **Function**, **Prefab**.

## Attributes

![The For Loop Node Attributes.](https://2561100106-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ff6JZovzOqBctA4C1o76u%2Fuploads%2Fgit-blob-343a83cd788bc8ab3cc00fc0009c8a42ecf49a64%2Fforloopattributes.png?alt=media)

| Attribute                | Type     | Description                                                                |
| ------------------------ | -------- | -------------------------------------------------------------------------- |
| `First Index`            | **Int**  | The starting index.                                                        |
| `Last Index`             | **Int**  | The stopping index.                                                        |
| `Step`                   | **Int**  | The amount to increase or decrease by.                                     |
| `Is Last Index Included` | **Bool** | Notes whether the last index is included or excluded during the iteration. |

## Inputs

| Input             | Type      | Description                                                           |
| ----------------- | --------- | --------------------------------------------------------------------- |
| *Pulse Input* (►) | **Pulse** | A standard **Input Pulse**, to trigger the execution of the **Node**. |
| `First Index`     | **Int**   | The starting index.                                                   |
| `Last Index`      | **Int**   | The stopping index.                                                   |
| `Step`            | **Int**   | The amount to increase or decrease by.                                |

## Outputs

| Output             | Type      | Description                                                                                                                            |
| ------------------ | --------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| *Pulse Output* (►) | **Pulse** | A standard **Output Pulse**, to move onto the next **Node** along the **Logic Branch**, once this **Node** has finished its execution. |
| `Index`            | **Int**   | The output index.                                                                                                                      |
| `OnEnd`(►)         | **Pulse** | A **Pulse** that flows to an action, such as a **Console** message, once the **For Loop** has ended.                                   |

## See Also

* [**For Each Loop**](https://docs.incari.com/incari-studio/2023.2/toolbox/flow-control/foreachloop)

## External Links

* [*For loop explanation*](https://en.wikipedia.org/wiki/For_loop) on Wikipedia.
