Logging Trouble
Author |
Message |
illu45

|
Posted: Mon May 16, 2005 6:15 pm Post subject: Logging Trouble |
|
|
Hey all,
I'm having some trouble with logging ATM...
Every time I move a pawn, the following thing should happen:
code: |
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 |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Tony

|
Posted: Mon May 16, 2005 8:20 pm Post subject: (No subject) |
|
|
try
Turing: |
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

|
Posted: Mon May 16, 2005 8:47 pm Post subject: (No subject) |
|
|
Right now I have:
code: |
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

|
Posted: Tue May 17, 2005 11:44 am Post subject: (No subject) |
|
|
add line breaks
var logMessage : string := "Pawn moving from " + startxLetter + intstr (starty) + " to " + newxLetter + intstr (newy) + "\n" |
|
|
|
|
 |
|
|