
-----------------------------------
_justin_
Mon Mar 06, 2006 4:46 pm

Recorded info
-----------------------------------
Hey all

so i finally got my turiing program to record info and such 

var log, connections : int
open : log, "logs.txt", write
open : connections, "connections.txt", write 

i have that written at the begining of my program

write : connections, clientAddress 

and i have that so that everytime some one connects to my server it writes it down in a .txt file

so then i though i'd be able to record all the text and stuff that people are typing by using a 

write : log, clientNick, text

after each time they send the info to the server

   put "Ip Address: ", clientAddr (clientPort)
            put "User- ", clientNick (clientPort), " says: ", text
            write : log, clientNick, text


so i though that would work but for soem reason when i go to open the .txt file it is like 500 mb big after like 5 mins of only 3 users in the chat 

and all that shows up in the log.txt is 


Admin                                                                                                                                                                                                                                                           justin                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       â‚¬                                                                                                                                                                                                                                                               â‚¬                                                                                                                                                                                                                                                               â‚¬                                                                                                                                                                                                                                                               â‚¬                                                                                                                                                                                                                                                               â‚¬                                                                                                                                                                                                                                                               â‚¬                                                                                                                                                                                                                                                               â‚¬                                                                                                                                                                                                                                                               â‚¬                                                                                                                                                                                                                                                               â‚¬                                                                                                                                                                                                                                                               â‚¬                                                                                                                                                                                                                                                               â‚¬                                                                                                                                                                                                                                                               â‚¬                                                                                                                                                                                                                                                               â‚¬                                                                                                                                                                                                                                                               â‚¬                                                                                                                                                                                                                                                               


and the â‚¬'s just keep going on and on

so if you can help that would be awesome 

btw here is the loop were the write statement is located

loop
        waitForChar (incomingConnection (clientPort))
        get : incomingConnection (clientPort), text : *
        if text not= "exit" then
            put "Ip Address: ", clientAddr (clientPort)
            put "User- ", clientNick (clientPort), " says: ", text
            write : log, clientNick, text
            put  "_____________________________________________"
            relayText (clientPort)
        elsif text = "exit" then
            put "Ip Address: ", clientAddr (clientPort)
            put "User: ", clientNick (clientPort), " has exited."
            relayServerMessage (clientPort, exitText)
            Net.CloseConnection (incomingConnection (clientPort))
            incomingConnection (clientPort) := 0
        end if
        exit when text = "exit"

    end loop

-----------------------------------
_justin_
Mon Mar 06, 2006 5:42 pm


-----------------------------------
sry i couldn't find the edit button 


k but now i kinda fixed it up now i ahve te logs.txt file looking like this though

    this is a test                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      soon i will have 5 other users in here                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       think you can handle it ? in here                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               yea k you can handle it ? in here                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               exit  you can handle it ? in here

as you notice it jsut copies every thing and replaces the

soon i will have 5 other users in here                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       think you can handle it ? in here                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               yea k you can handle it ? in here                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               exit  you can handle it ? in here[/b]

-----------------------------------
Clayton
Mon Mar 06, 2006 5:50 pm


-----------------------------------
just so you know, your obviously new here, but there is no edit button in the help forum, but anyway how long have you been programming? a chat program is pretty cool, but i dont know where that in here is coming from, its an interesting problem

-----------------------------------
MysticVegeta
Mon Mar 06, 2006 6:52 pm


-----------------------------------
sry i couldn't find the edit button 


k but now i kinda fixed it up now i ahve te logs.txt file looking like this though

    this is a test                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      soon i will have 5 other users in here                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       think you can handle it ? in here                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               yea k you can handle it ? in here                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               exit  you can handle it ? in here

as you notice it jsut copies every thing and replaces the

soon i will have 5 other users in here                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       think you can handle it ? in here                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               yea k you can handle it ? in here                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               exit  you can handle it ? in here

What are you trying to say? I dont understand, speak using full forms of words and proper grammar, really hard to make out what you are saying

-----------------------------------
_justin_
Mon Mar 06, 2006 9:21 pm


-----------------------------------
Ack now that i re-read it it doesnt really make much sense to me


sry i couldn't find the edit button 


k but now i kinda fixed it up now i have the logs.txt file looking like this but
as you notice it just copieswhatever was written before and tries to write over it

soon i will have 5 other users in here 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      think you can handle it ? in here 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              yea k you can handle it ? in here 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              exit  you can handle it ? in here


so basicly i want the log file to just list the username then what they said
for example 

"Justin - hello, world"
"John Doe - Hello,world"
"Jane Doe- Hello, world"


hope that clears things up if not just tell me and i'll try again

-----------------------------------
MysticVegeta
Tue Mar 07, 2006 11:47 pm


-----------------------------------
try to use "put : fileNo, text" instead of write.
