# Load Data from Textfile into Variables for FOR-Loops

**URL:** <https://forum.kirupa.com/t/load-data-from-textfile-into-variables-for-for-loops/102968>\
**Category:** Uncategorized\
**Created:** [February 29, 2004, 7:57am UTC](https://forum.kirupa.com/t/load-data-from-textfile-into-variables-for-for-loops/102968 "2004-02-29T07:57:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neijia](https://avatars.discourse-cdn.com/v4/letter/n/8797f3/32.png) [@Neijia](https://forum.kirupa.com/u/Neijia)\
**Post date:** [February 29, 2004, 7:57am UTC](https://forum.kirupa.com/t/load-data-from-textfile-into-variables-for-for-loops/102968/1 "2004-02-29T07:57:05Z")

</div>

hello,

I’m new in this Forum, so I’m quite unfamiliar with it by now.  
If I’m posting wrong, please tell me so I can learn

My Question:

I’m making something like a dynamic Picture Viewer, wich should display Pictures named by photo1, photo2, etc. dynamically from an url I give the viewer as a parameter. Thats not my problem by now, my problem is that I try to give the viewer few “parameters” through a text-file

NumberOfPictuers=12

I load this file like this

loadNumber = new loadVars();

loadNumer.onLoad = function()  
{  
/\* - And here’s the problem: I want to load the variable not into a  
textbox, but into a variable like i for example, so I tried it like this\*/

txtHelpText.text=this.NumberOfVariables;  
}

//outside the function i tried this

i=txtHelpText.text;

//I tried to reassign directly into i (inside the onLoad-function), like this

i=this.NumberOfVariables

I tried a lot but, didn’t succed to get the data from the textfile into  
i so i can use it like this

for (k=1; k==i; k++)

or to use it for other purposes.

If someone nows an answer, please help,

Like I said I’m new with this, if I’m posting wrong, or if the problem is to easy for this forum I’m sorry.

Thanks for the help  
Aleksandar
