Indicator error

Back to topics list To post a new topic, please log in or register
avatar
113
pontuso 2015.01.14 10:39
 

Hi

I have downloaded the attached indicator and it has been working for a while, but today when i was looking at the file inside MetaEditor and i compiled it (without changing anything)

I got this errors?? and the EA stopped to work.

Compiling

This is the error part of the indicator.

void WriteToLogFile(string input)
{
   string filename = "Spread_Recording/"+Symbol()+"-Spread_Recorder-"+Day()+"-"+Month()+"-"+Year()+".log";
   input = TimeHour(TimeCurrent())+":"+TimeMinute(TimeCurrent())+":"+TimeSeconds(TimeCurrent())+" - "+input;
   int handle = FileOpen(filename,FILE_READ|FILE_WRITE);
   if (handle>1)
   {
      FileSeek(handle, 0, SEEK_END); // go to end of file
      FileWrite(handle, input);
      FileClose(handle);
   }
}

Does anyone know how i can fix it?

Attached files:
  spread_recorder.mq4  (2.51 KB)
avatar
735
honest_knave 2015.01.14 10:47 #
 

input is now a reserved word (case sensitive).

Try changing it to something else, for example Input

void WriteToLogFile(string Input)
{
   string filename = "Spread_Recording/"+Symbol()+"-Spread_Recorder-"+Day()+"-"+Month()+"-"+Year()+".log";
   Input = TimeHour(TimeCurrent())+":"+TimeMinute(TimeCurrent())+":"+TimeSeconds(TimeCurrent())+" - "+Input;
   int handle = FileOpen(filename,FILE_READ|FILE_WRITE);
   if (handle>1)
   {
      FileSeek(handle, 0, SEEK_END); // go to end of file
      FileWrite(handle, Input);
      FileClose(handle);
   }
}
avatar
113
pontuso 2015.01.14 11:59 #
 
honest_knave:

input is now a reserved word (see how it is colored blue?).

Try changing it to something else, for example Input

Thnks! it works now =)
Back to topics list  

To add comments, please log in or register