File Function

To add comments, please log in or register
chua le
383
chua le  
 handle=FileOpen("File1.csv",FILE_CSV|FILE_READ|FILE_WRITE,',');
 FileSeek(handle,0,SEEK_END); 
 FileWrite(handle,Symbol(),TimeToStr(CurTime(),TIME_DATE|TIME_SECONDS),Profit);
 FileClose(handle);

 handle=FileOpen("File1.csv",FILE_CSV|FILE_READ|FILE_WRITE,',');
 FileSeek(handle,0,SEEK_END); 
 FileWrite(handle,Lost);
 FileClose(handle);

Hi,

I  intended to write the "Lost" in the same row after "Profit" but it goes to new line. How to write it in the same row?


Regards 

Seng Joo Thio
1218
Seng Joo Thio  
chua le:

Hi,

I  intended to write the "Lost" in the same row after "Profit" but it goes to new line. How to write it in the same row? 

Assuming you'll only append to the last row, you can change:

 FileSeek(handle,0,SEEK_END); 
 FileWrite(handle,Lost);

to:

   FileSeek(handle, -2, SEEK_END);
   FileWrite(handle,"",Lost);
chua le
383
chua le  
Thanks Bro
To add comments, please log in or register