Is it possible to use a number from a variable in a text file?

Hey guys I’ve got a question over something that should be simple but it’s doin my head in cause It doesnt work!

I got a “for in” loop loading variables from a textfile, I want to get from it the number of items to display.

in the text file the variable “sectionitems” corresponds to a string, “8”.

–> &sectionitems=2

but this doesnt work:

for(i=0;i<=sectionitems;i++) {

If I do that doesnt work as well, it makes as infinite loop

Number(sectionitems);


loadItems = new LoadVars();
loadItems.load("test.txt");
loadItems.onLoad = function() {
	nitems = this.sectionitems;
	test_tf.text = nitems;
	trace("nitems = " + nitems);
	for(i=0;i<=nitems;i++) {
		trace(i);
	}
}

this still makes an infinite loop !

how is it possible to use a number from a variable in a text file ?