PRINT "Welcome to Messenger" PRINT "[connected to host]" INPUT "Enter your name: ", myname$
PRINT #client
, myname$
+ " connected!" PRINT "To Exit, press the Escape key" GetMessage client
SendMessage myname$, mymessage$, client
PRINT "Server wasn't found, hosting on LAN" PRINT "[Beginning new chat session!]" numclients = 1
IF client
= 0 THEN PRINT "ERROR: could not attach host's personal client to host!" INPUT "Enter your name:", myname$
PRINT #client
, myname$
+ " connected!" PRINT "To Exit, press the Escape key" PRINT "[Chat session active!]" numclients = numclients + 1
Users(numclients) = newclient
PRINT #Users
(numclients
), "Welcome!" INPUT #Users
(i
), message$
GetMessage client
SendMessage myname$, mymessage$, client
PRINT "ERROR: Could not begin new host!"
'Frontend below
INPUT #client
, newmessage$
SUB SendMessage
(myname$
, mymessage$
, client
) mymessage$
= LEFT$(mymessage$
, LEN(mymessage$
) - 1) IF mymessage$
= "" THEN SYSTEM ' [Enter] with no message ends program PRINT #client
, myname$
+ ": " + mymessage$
mymessage$ = ""