I wish to include a log file for my game - which will recird chat messages/system notes etc.
I had assumed it's not a good idea to keep the stream open ALL the time, so it will be opened, written to, then closed again each time.
This causes a problem if I need to add consecutive lines later, as each time I open it, the 'pointer' moves to the start of the file.
The immediate workaround I thought of was to read the contents each time, then re-write. Thjis of course, would take too long with large logs and defeat the object of having the file...
Is there a simple way to 'move' to the EOF?
here's my trial code:
I had assumed it's not a good idea to keep the stream open ALL the time, so it will be opened, written to, then closed again each time.
This causes a problem if I need to add consecutive lines later, as each time I open it, the 'pointer' moves to the start of the file.
The immediate workaround I thought of was to read the contents each time, then re-write. Thjis of course, would take too long with large logs and defeat the object of having the file...
Is there a simple way to 'move' to the EOF?
here's my trial code:
Graphics3D 800,600,32 ;CLEAR LOG FOR NEW GAME debug=OpenFile ("Log.log") While Not Eof (debug) WriteLine debug,"" Wend WriteLine debug,"START OF LOG" CloseFile debug ;LATER ON - CONSECUTIVE LINE sphere=CreateSphere(10) debug=OpenFile ("Log.log") WriteLine debug,"Created Sphere" CloseFile debug