# Help creating some sort of loop or array

**URL:** https://forum.kirupa.com/t/help-creating-some-sort-of-loop-or-array/239296
**Category:** Uncategorized
**Created:** [September 20, 2007, 9:29am UTC](https://forum.kirupa.com/t/help-creating-some-sort-of-loop-or-array/239296 "2007-09-20T09:29:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![clodagh2000](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@clodagh2000](https://forum.kirupa.com/u/clodagh2000)
#### Post date: [September 20, 2007, 9:29am UTC](https://forum.kirupa.com/t/help-creating-some-sort-of-loop-or-array/239296/1 "2007-09-20T09:29:52Z")

</div>

Hi,

I need to make some sort of a loop or an array or something to make this easier so I wont have to type out thousands of lines of code. Could someone help me with this…not quite sure exactly how to do it…need a few tips or guidelines to get me on the way.

I have a few if statements looking like this:

if(counter == 1){  
tField.htmlText = ‘\<font color="#DD0000"\>f\</font\>’  
}  
if(counter == 2){  
tField.htmlText = ‘\<font color="#000000"\>f\</font\>  
\<font color="#DD0000"\>f\</font\>’

```
        }

```

if(counter == 3){  
tField.htmlText = ‘\<font color="#000000"\>f\</font\>  
\<font color="#000000"\>f\</font\>  
\<font color="#DD0000"\>f\</font\>’  
}

and I am going to have to do this up until the counter reaches 540. Whereby the last line in the \<font color= will always be different to the ones before it. The last line will have the color ‘#DD000’ whereas the rest before it will have the color black (#DD0000)

could anyone show me how I could make a fancy loop to do this, instead of me having to write this out 540 times.

Any help would be much appreciated.

Clodagh2000:)
