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

Username:   Password: 
 RegisterRegister   
 Chat Program
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Delta




PostPosted: Fri Mar 21, 2003 10:31 am   Post subject: Chat Program

Here is my chat program I'm not sure if it works over the net but it does work over the network(LAN). I would have made it a excutable but it doesn't work right if I do so. But here it is any ways.

Comments and Suggestions are appreciated.

I wasnt able to test it, but from what I've seen, I looks nice... Giving 10bits - Tony
Sponsor
Sponsor
Sponsor
sponsor
Asok




PostPosted: Fri Mar 21, 2003 11:33 am   Post subject: (No subject)

hitting cancel ends the program which is rather annoying.
Delta




PostPosted: Fri Mar 21, 2003 3:07 pm   Post subject: ...

The only way that it ends is if you hit the exit menu item or yeah the [X] at the top of the window which I couldn't get away from right away but I'm working on it. Smile But in all the windows that pop up there is a cancel/close button, except the host window.
JayLo




PostPosted: Fri Mar 21, 2003 6:18 pm   Post subject: another chat program

here's another to add to the bunch.

MOD Edit: Interesting... +10bits -Tony



Chat.zip
 Description:

Download
 Filename:  Chat.zip
 Filesize:  326.39 KB
 Downloaded:  1347 Time(s)

Delta




PostPosted: Fri Mar 21, 2003 6:41 pm   Post subject: ?????

How did you make it so if the [X] in the top was clicked it wouldn't exit the program????????????????
Tony




PostPosted: Fri Mar 21, 2003 6:43 pm   Post subject: (No subject)

I think that when compiling the program, you get an option to NOT allow the user to terminate the program... You need v4.x compiler though Confused
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Delta




PostPosted: Fri Mar 21, 2003 6:43 pm   Post subject: The Whole chat thing

all you need to start the chat program is not much at all it is pretty much just this .
code:

var stream : int := 0 % Used for sending data
var msgBack : string % The message that gets sent back and forth
var address : string % IP address for each computer
var message : string
var status : int

const PORT := 5555 % Port to connect through

put "What would you like to do?"
put "1:Host"
put "2:Join"

get status

if status = 1 then
    stream := Net.WaitForConnection (PORT, address)
else
    put "What is the IP of the computer you want to connect to?"
    get address
    stream := Net.OpenConnection (address, PORT)
end if
cls
put "Connected to ", address

loop
    if hasch then
        get message : *
        put : stream, message       
    end if
    if Net.LineAvailable (stream) then
        get : stream, msgBack : *
        put msgBack
    end if
end loop
Tony




PostPosted: Fri Mar 21, 2003 6:44 pm   Post subject: (No subject)

hey Delta... rewrite that as a tutorial and I'll give you a bunch of bits for it Wink
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sponsor
Sponsor
Sponsor
sponsor
Delta




PostPosted: Fri Mar 21, 2003 6:49 pm   Post subject: (No subject)

OK I will rewrite it right now where should I post it? In the tutorials page
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 9 Posts ]
Jump to:   


Style:  
Search: