Quick Fix ???

 

I'm trying to write data to a file but it keeps writing it over the old data, i'm using the file seek function but it doesn't seem to like me, is their something small i'm doing wrong?


int start()

{


if(Hour() == 17 && hit == true)

{

handle=FileOpen("test_2", FILE_CSV|FILE_WRITE,';');

FileSeek(handle,0,SEEK_END);

if(handle >0)

{

FileWrite(handle,"Close =",NormalizeDouble(Close[1],4));

FileClose(handle);

handle = 0;

Print("Closing Price Printed ",Close[1]);

hit = false;

}

else

{

Print("Filenot found, the last error is ", GetLastError());

}

}

if(Hour() > 17 && hit == false)

hit = true;


 
Bauer_Boy:

I'm trying to write data to a file but it keeps writing it over the old data, i'm using the file seek function but it doesn't seem to like me, is their something small i'm doing wrong?

handle=FileOpen("test_2", FILE_CSV|FILE_READ|FILE_WRITE,';');
 
gordon:

Quick fix like I said :), thanks a lot