Is there any way in Ebasic to do a fflush()? I'm writing an error logging module and I want to keep the log file buffer flushed in case of program crash so all the messages will be in the log up to the crash.
The simplest way is just to close the file after each write.
OpenFile(LogFile, LogFileName, "A")
...write
CloseFile(LogFile)
Which is a method I use on a larger server project.
Of course if you just want to use the Windows API both the FILE and BFILE variables are a handle to the open file created with CreateFile:
Declare import, FlushFileBuffers(uint hFile),int
...
FlushFileBuffers(LogFile)
Thanks!