
-----------------------------------
illu45
Mon May 16, 2005 6:15 pm

Logging Trouble
-----------------------------------
Hey all,

I'm having some trouble with logging ATM...

Every time I move a pawn, the following thing should happen:


var logMessage : string := "Pawn moving from " + startxLetter + intstr (starty) + " to " + newxLetter + intstr (newy)
open : logFile, filename, write
write : logFile, logMessage
close : LogFile


Basically what I'm doing is opening the file, writing where the pawn is moving to and where its moving from, the nclosing the file. However, when I look at the LogFile, I only see an entry for the last pawn to move... So I'm guessing that it's overwriting the previous entry... 

Any ideas on how to fix this?

Thanks,
illu45

-----------------------------------
Tony
Mon May 16, 2005 8:20 pm


-----------------------------------
try

open : logFile, filename, write, seek
seek: *
write : logFile, logMessage
close : LogFile 

if that fails (since I don't have access to Turing documentation) just lookup (F10) seek for random file access.

-----------------------------------
illu45
Mon May 16, 2005 8:47 pm


-----------------------------------
Right now I have:


open : logFile, filename, write, mod
write : logFile, logMessage


It writes it in... but its all in a really long line, which goes on forever...

Any ideas?
ilu45

-----------------------------------
Tony
Tue May 17, 2005 11:44 am


-----------------------------------
add line breaks

var logMessage : string := "Pawn moving from " + startxLetter + intstr (starty) + " to " + newxLetter + intstr (newy)  + "\n"
