# A loop that creats Arrays

**URL:** <https://forum.kirupa.com/t/a-loop-that-creats-arrays/193033>\
**Category:** Uncategorized\
**Created:** [July 3, 2006, 7:44pm UTC](https://forum.kirupa.com/t/a-loop-that-creats-arrays/193033 "2006-07-03T19:44:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sivant](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sivant](https://forum.kirupa.com/u/sivant)\
**Post date:** [July 3, 2006, 7:44pm UTC](https://forum.kirupa.com/t/a-loop-that-creats-arrays/193033/1 "2006-07-03T19:44:51Z")

</div>

i am trying to create a loop that will put a list of names from external sources into a number of Arrays .so what i did is :

```auto
for (i=0; i<4; i++) {
 this["loadVarsText"+i] = new LoadVars();
 this["loadVarsText"+i].onLoad = function(success) {
  if (success) {
   originText = this.textVar;
   this["cdNames"+i] = new Array();
   this["cdNames"+i] = "loadVarsText"+i.textVar.split(",");
  }
 };
 this["loadVarsText"+i].load("cd"+i+".txt", originText);
}

```

and i dont understand why it is not working, and how can i fix it?
