# Variable variables

**URL:** <https://forum.kirupa.com/t/variable-variables/200230>\
**Category:** Uncategorized\
**Created:** [September 10, 2006, 12:29pm UTC](https://forum.kirupa.com/t/variable-variables/200230 "2006-09-10T12:29:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![amanuo](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@amanuo](https://forum.kirupa.com/u/amanuo)\
**Post date:** [September 10, 2006, 12:29pm UTC](https://forum.kirupa.com/t/variable-variables/200230/1 "2006-09-10T12:29:19Z")

</div>

Hi,

I’ve got a button which is supposed to make a new variable, and give it an ongoing number.  
So far i’ve got a number variable, and the contents of the variables, but i’m not sure how to put the variable together and give it the content.

Eventually it’s supposed to create a neverending list of variables (adding 1 each time you press the button).  
Pressing button 1 will give: [COLOR=Blue]item1 = “button1result”;[/COLOR]  
Pressing button 2 will then give: [COLOR=Blue]item2 = “button2result”;[/COLOR]  
Pressing button 1 again will then give: [COLOR=Blue]item3 = “button1result”;

[COLOR=Black]So far i’ve got this when the button is pressed:

[COLOR=Blue] number = number + 1;  
if(nummer == 1){  
item1 = thevar;  
}  
else{  
item [COLOR=Red][+ nummer][/COLOR] = thevar + “\<br\>”;  
}

[COLOR=Black]How should the item variable get the proper number behind it? (the red part)[/COLOR]  
[/COLOR][/COLOR]  
[COLOR=Black]Hope anyone will understand… I’m trying hard to be clear about this.[/COLOR]  
[/COLOR]
