Page 1 of 1

Error Using FileAppend

Posted: Sep 13 2012
by tony95
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

Re: Error Using FileAppend

Posted: Sep 13 2012
by tony95
And why do my posts display centered?

Re: Error Using FileAppend

Posted: Sep 14 2012
by Henry MultiŠ”harts
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).