Read from file error!

 

Hello!



I would read two string from file,(file.txt),but don't work for me,I recieive two error message:Too many Opened Files,and File was not found!

the file.txt in tester/Files folder.


Here is the code:

extern string FileName = "file.txt";

int init()
{
return(0);
}

int deinit()
{
return(0);
}

int start()
{
int handle;
handle=FileOpen(FileName,FILE_CSV|FILE_READ,';');
if(handle<1)
{
Print("File was not found: ", GetLastError());
return(false);
}
int i= 0;
while(!FileIsEnding(handle))
{
string one=FileReadString(handle);
string two=FileReadString(handle);
FileReadString(handle);
i++;
}
//----

//----
return(0);
}

//+------------------------------------------------------------------+


Thanks for help!

 
Every time when the start function runs You open file but don't close it
Reason: