FileIsLineEnding not working in my code

 

Here is the code:  

int file = FileOpen("candles.csv",FILE_WRITE|FILE_READ|FILE_CSV|FILE_COMMON|FILE_SHARE_READ,',');
if(file!= INVALID_HANDLE)
{
while(FileIsLineEnding(file)) Print(FileReadString(file));
}
else
{
Print("File Not Found : ",GetLastError());
}

I cannot see the header of the file. Please let me know what is the issue. When I wrote one single line to print I got only on part of the header:  

int file = FileOpen("10001candles.csv",FILE_WRITE|FILE_READ|FILE_CSV|FILE_COMMON|FILE_SHARE_READ,',');
if(file!= INVALID_HANDLE)
{
Print(FileReadString(file));
}
else
{
Print("File Not Found : ",GetLastError());
}

output: 
at

My header is: at,locate,along,suspend

Please let me know. What mistake I made.

 
jaffer wilson:

Here is the code:  

I cannot see the header of the file. Please let me know what is the issue. When I wrote one single line to print I got only on part of the header:  

My header is: at,locate,along,suspend

Please let me know. What mistake I made.

while(!FileIsLineEnding(file)) Print(FileReadString(file));
 
Petr Nosek:

Thank you. It helped a lot.

Reason: