Error Using FileAppend

Questions about MultiCharts and user contributed studies.
tony95
Posts: 20
Joined: 10 Sep 2012
Has thanked: 4 times
Been thanked: 2 times

Error Using FileAppend

Postby tony95 » 13 Sep 2012

I am using FileDelete and FileAppend to output indicator values to a file.

Code: Select all

if LastBarOnChart then
begin
   filepath = "c:\mcdata\" + FileName + ".txt";
   FileDelete(filepath);
   FileAppend( filepath , NumToStr(var1[0],0) + "," + NumToStr(var1[1],0) + "," + NumToStr(var1[2],0) + "," +
      NumToStr(currentbar,0) + "," + NumToStr(Date,0) + "," + NumToStr(time_s,0) + "," + NumToStr(Close[0],5)  );
end;


Every so often I get an Error: Can't open/create file.

I am NOT accessing the file when the error occurs.

Is there a way to make the error stop or to ignore it would work too. I have to go back and unhide the study every time this happens.

I am using MC8 64.

Thanks, Tony
Last edited by tony95 on 13 Sep 2012, edited 1 time in total.

tony95
Posts: 20
Joined: 10 Sep 2012
Has thanked: 4 times
Been thanked: 2 times

Re: Error Using FileAppend

Postby tony95 » 13 Sep 2012

And why do my posts display centered?

User avatar
Henry MultiСharts
Posts: 8443
Joined: 25 Aug 2011
Has thanked: 1207 times
Been thanked: 2704 times

Re: Error Using FileAppend

Postby Henry MultiСharts » 14 Sep 2012

tony95, please attach the workspace you are using for reproducing this behavior and export of your study with dependent functions (Power Language editor->File->Export->export with dependent functions).


Return to “MultiCharts”