The For Loop does not know how many times to execute. You must either wire the N count terminal of the For Loop or connect an array wire to the edge of the For Loop with indexing enabled.

You can correct this error in the following ways:

  • Wire any integer value to the N count terminal. In the following example, a constant value is wired to the N terminal, which will make the For Loop execute five times.

  • Wire an array to the edge of the For Loop. When you connect an array to the edge of a For Loop, the tunnel is set to Enable Indexing by default. The For Loop executes once for every element in the array. In the following example, an array of integers is wired to the edge of the For Loop. The For Loop will execute four times because there are four elements in the array.

    You can have multiple tunnels with indexing enabled. The For Loop will execute as many iterations as the smallest array. In the following example, the For Loop will execute three times because the smallest array has only three elements.

  • You can wire the N count terminal and have indexing tunnels. The For Loop executes as many iterations as the smallest value. In the following examples, both the N count terminal and an indexing tunnel are wired. In the first example, N is wired with 2, which is smaller than the number of elements in the array, so the For Loop will execute twice. In the second example, the For Loop is wired with 8, but there are only 3 elements in the array, so the For Loop will execute three times.