# Problems with dynamic variable names

**URL:** <https://forum.kirupa.com/t/problems-with-dynamic-variable-names/122283>\
**Category:** Uncategorized\
**Created:** [September 12, 2004, 1:17pm UTC](https://forum.kirupa.com/t/problems-with-dynamic-variable-names/122283 "2004-09-12T13:17:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![OM2](https://avatars.discourse-cdn.com/v4/letter/o/3ab097/32.png) [@OM2](https://forum.kirupa.com/u/OM2)\
**Post date:** [September 12, 2004, 1:17pm UTC](https://forum.kirupa.com/t/problems-with-dynamic-variable-names/122283/1 "2004-09-12T13:17:15Z")

</div>

I want to write code where I have arrays of objects.  
I want to write a for loop and have something like:

[size=2][size=2]myObject1 = new Object();  
[/size][/size][size=2][size=2]myObject2 = new Object();  
[/size][/size][size=2][size=2]myObject3 = new Object();  
[/size][/size][size=2][size=2]myObject4 = new Object();  
etc…  
[/size][/size]  
How can I do this?  
I’ve tried using square brackets… it doesn’t work and looks wrong to do anyway.

Any help would be appreciated.

Thanks.

OM
