...
2013.11.07 21:15:31 File Writing GBPUSD,H4: 0 File Handle: 1
2013.11.07 21:15:31 File Writing GBPUSD,H4: Before: -89
2013.11.07 21:15:31 File Writing GBPUSD,H4: After Flush: 1102
2013.11.07 21:15:31 File Writing GBPUSD,H4: End: 1102
0 is indeed the first value in the file.
Can someone tell me why I get a negative file position at the very beginning? I just want to jump back to the position I was before flushing. Where did I make the obvious mistake I am not seeing?
Inserted Code
int handle = FileOpen(fileName,FILE_CSV|FILE_READ |FILE_WRITE,",");
Print(FileReadString(handle) + " File Handle: " + handle);
int pos = FileTell(handle);
Print("Before: " + pos);
FileFlush(handle);
Print("After Flush: " + FileTell(handle));
FileSeek(handle,pos,SEEK_SET);
Print("End: " + FileTell(handle)); 2013.11.07 21:15:31 File Writing GBPUSD,H4: 0 File Handle: 1
2013.11.07 21:15:31 File Writing GBPUSD,H4: Before: -89
2013.11.07 21:15:31 File Writing GBPUSD,H4: After Flush: 1102
2013.11.07 21:15:31 File Writing GBPUSD,H4: End: 1102
0 is indeed the first value in the file.
Can someone tell me why I get a negative file position at the very beginning? I just want to jump back to the position I was before flushing. Where did I make the obvious mistake I am not seeing?