How to print ?

To add comments, please log in or register
BB2013
125
BB2013  

Hi,

I am a new user of the MQL4 programming. For a starter the function PRINT is very important in order to debug the program. The problem is that I dont know where this output is presented in my screen ?

Can someone help ?

Thanks

meikel
365
meikel  

Tab "journal"

i prefer writing to a file...

the file is in the experts/files or tester/files folder


///////////////////////// example

extern string FileName="log.txt";

string Text;

int init
{
  FileDelete(FileName) ;
}


int start
{
  Text="Profit "+OrderProfit()+"\n";// \n means new line at the end - each text one line in the file
  Log(FileName,Text);
}


void Log(string FileName,string Text)
{
  int FileHandle=FileOpen(FileName, FILE_BIN|FILE_WRITE|FILE_READ);
  if(FileHandle>0)
     {
      FileSeek(FileHandle, 0, SEEK_END);
      FileWrite(FileHandle,Text) ;
      FileClose(FileHandle);
     }
}
BB2013
125
BB2013  
meikel wrote >>
Tab "journal"

Thanks

To add comments, please log in or register