I have a simple Logging function for a project, but I can't seem to get it to work correctly. Currently, the code just seems to overwrite a single line each time.
I am not sure if it's related to the closing and re-opening. (Incidentally, what diffeerence(s) are there between OpenFile and WriteFile? ) However, I don't like to leave any files Open, especially as my program may involve other read/writes to other files elsewhere.
Any help would be really appreciated.
I am not sure if it's related to the closing and re-opening. (Incidentally, what diffeerence(s) are there between OpenFile and WriteFile? ) However, I don't like to leave any files Open, especially as my program may involve other read/writes to other files elsewhere.
Function Debug(sDebugFunction$="APPLICATION RUN",sDebugResult$="LOG START") If (DebugOn()) DebugFile=WriteFile(fLOGFILE$) SeekFile(DebugFile,FileSize(fLOGFILE$)) sLine$=CurrentDate$()+" | "+CurrentTime$()+" | "+sDebugFunction$+" | "+sDebugResult$ WriteLine(DebugFile,sLine$) CloseFile DebugFile EndIf Return End Function
Any help would be really appreciated.