# For(i = 0; i \< arrayLength; i++)

**URL:** <https://forum.kirupa.com/t/for-i-0-i-arraylength-i/173445>\
**Category:** Uncategorized\
**Created:** [December 25, 2005, 6:17pm UTC](https://forum.kirupa.com/t/for-i-0-i-arraylength-i/173445 "2005-12-25T18:17:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wayne](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/wayne/32/16501_2.png) [@Wayne](https://forum.kirupa.com/u/Wayne)\
**Post date:** [December 25, 2005, 6:17pm UTC](https://forum.kirupa.com/t/for-i-0-i-arraylength-i/173445/1 "2005-12-25T18:17:47Z")

</div>

hey  
long time ago i have been here,  
good to see everything is better than before 🙂 Mery Christmas to all

im trying to learn more AC in flash 8 but i have problems with understanding some lines like this one, are used same formation in many codes i have seen can someone explane or give an url for to understand more, or what it is called

for(i = 0; i \< arrayLength; i++)

the thing i do not understand is this line what does he mean like ( i \< variable ) in this code and i know that the new number (i) is plussing it selv one more time with i++ and with (i=0) means i is 0 ? and its smaller than arrayLenth(var\*)

im a bit confused about this.

hole code is here

```auto
var myArr:Array = new Array();

function initArray(arrayLength:Number):Void {

  var i:Number;

  for(i = 0; i < arrayLength; i++) {

    myArr* = i + 1;

  }

}

trace(myArr); // <blank>

initArray(3);

trace(myArr); // 1,2,3

trace(i); // undefined

```

but what i dont understand is

```auto
for(i = 0; i < arrayLength; i++) {

```

or like this one also uses same formation

```auto
_global.counter = 100; // Declares global variable

trace(counter); // Accesses the global variable and displays 100

function count():Void {

  for (var counter:Number = 0; counter <= 2; counter++) { // Local variable

    trace(counter); // Accesses local variable and displays 0 through 2

  }

}

count();

trace(counter); // Accesses global variable and displays 100

```

thank you very much
