Can't read double or string from a simple CSV file?

Luka Savic
14
Luka Savic  

Hi all, I have a problem doing some simple file reading in MQL5, while I was able to do the same pretty fast in MQL4.

Here's the problem. I'm trying to read double and string from a CSV file that looks like this:

0,EURUSD,8.555000000038934,1,0,1.18117,1.1810900000000004,1.18129

Here is the code I'm using to do this. When I try to print the entry or any other double, I get only zeros. When I try to print symbol, I get nothing, only when I compare a symbol to "EURUSD" I get that it actually is EURUSD...

Really don't understand what's the problem..?

if(done==0){
   int file = FileOpen("trades.csv",FILE_READ|FILE_CSV,',');
   if(file<0)Alert("fajl je sjeban");
   //Alert(file);
   int trade_or_not = (int)FileReadNumber(file);
   string symbole = FileReadString(file,6);
   double lot = FileReadNumber(file);
   double order_typer = FileReadNumber(file);
   double order_direction = FileReadNumber(file);
   double entry = FileReadNumber(file);
   double tp = FileReadNumber(file);
   double sl = FileReadNumber(file);
   //Alert(trade_or_not);
   if(StringCompare("EURUSD",symbole)!=0)Print("eurusd je");
   Print(entry);
   done=1;
   Sleep(10);
   FileClose(file);
   }
Alain Verleyen
41522
Alain Verleyen  
Check FILE_ANSI and FILE_UNICODE.
Luka Savic
14
Luka Savic  
Alain Verleyen:
Check FILE_ANSI and FILE_UNICODE.
Thanks Alain, I tried FILE_UNICODE before and it didn't do the job, but FILE_ANSI did!!