FileOpen(..., FILE_READ|FILE_WRITE|FILE_CSV); FileSeek(..., SEEK_END);
Ivan Titov #:
Exactly what I needed. Thank you very much!
//+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { int filehandle=FileOpen("test.csv",FILE_READ|FILE_WRITE|FILE_CSV); if (filehandle!=INVALID_HANDLE) { FileSeek(filehandle,0,SEEK_END); FileWrite(filehandle,TimeToString(TimeCurrent(),TIME_SECONDS)); } FileClose(filehandle); }

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello guys,
can someone tell me how to update a file without overwriting it? I made a small script which saves the current time to the file TEST.CSV. This script overwrites the file before but I want it to add the current time to the existing file so when I execute the script 5 times I want to see 5 different times. I think I have to open and read the file before and write the time at the end of the file but I don't know how to do it. Can someone help me with this?