Download MetaTrader 5

Read from a .txt file

To add comments, please log in or register
mpp
14
mpp  

Hi all,


I'm having some problems on reading a value from a .txt file in an Expert Advisor.


I have the following code:

int file_handdle=FileOpen("test.txt",FILE_READ|FILE_ANSI);
   string string_read=FileReadString(file_handdle,4);
   
   Print("String read: " + string_read);
   
   FileClose(file_handdle);


But when executed it just shows on console:

String read: 
String read: 
String read: 
String read: 
String read: 


Can you find what I'm doing wrong?


Thanks:)

To add comments, please log in or register