Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Logging Trouble
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
illu45




PostPosted: 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
Sponsor
sponsor
Tony




PostPosted: 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




PostPosted: 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




PostPosted: 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"
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: