Retrieve dynamic form variable names with SolutionModel

I’m changing an existing form and adding form variables with the SolutionModel like this:

var form = solutionModel.getForm('form_name');
for (var i = 0; i < numberOfVariables; i++) {
	var variable = form.newFormVariable('formVariable' + i, JSVariable.TEXT)
	variable.defaultValue = '"value"';
	var field = form.newField(variable, JSField.TEXT_FIELD, 0 ,0, 100, 20);
}

Then after the user changes the value of these form variables, I want to retrieve them. Now I want to display all their values and so I use a loop:

for (var i = 0; i < numberOfVariables; i++) {
	application.output(forms['form_name'].formVariable;
}

Now, with what should I replace the last ‘formVariable’ to make sure I retrieve values for ‘formVariable1’, formVariable2’, formVariable3’ and so on? It’s not an array, so '’ isn’t working and neither is ‘+i’.
I think I’m missing some trick here. Does anyone have an idea?

vincentSchuurhof:
application.output(forms[‘form_name’].formVariable

forms[form_name][‘formVariable’ + i] should do the job

Hope this helps

Thanks Marc, that helped indeed! :-)