home *** CD-ROM | disk | FTP | other *** search
- program Terminal_Chat;
- var evnt,i:integer;
- s,s1,s2,s3:string;
- v1,v2:integer;
- begin
- setbackcolor($000000);
- textcolor($FFFF00);
- setstatus('Client connected');
- writeln('Connected: '+nv_remoteip);
-
- repeat
- evnt:=waitevent(v1,v2);
- if evnt=7 then
- begin
- textcolor($00FF00);
- s:=getbroadcast;
- send(s);
- end else
-
- if evnt=1 then
- begin
- textcolor($00FF00);
- s:=recvln;
- writeln(s);
- sendbroadcast(s+chr(13)+chr(10));
- end else
-
- if evnt=6 then
- begin
- s1:='';s2:='';
- i:=getinputtext(s1,s2);
-
- if(v2<>0)then begin s3:=s1+s2; setinputtext(2,'');end
- else begin s3:=s1; setinputtext(1,'');end;
- s3:='<'+nv_cname+'> '+s3;
- send(s3+chr(13)+chr(10));
- textcolor($00FFFF);
- writeln(s3);
- end;
-
- until evnt=0;
- textcolor($FFFF00);
- writeln('Disconnected: '+nv_remoteip);
- end.
-