'************************************** ' Name: Chat program ' Description:Chat program useing arrays ' . ' By: Bhushan. ' ' ' Inputs:None ' ' Returns:None ' 'Assumes:None ' 'Side Effects:None 'This code is copyrighted and has limite ' d warranties. 'Please see http://www.Planet-Source-Cod ' e.com/xq/ASP/txtCodeId.7821/lngWId.4/qx/ ' vb/scripts/ShowCode.htm 'for details. '************************************** 1. //chatpage.asp
<%=NOW%>
<% TempArray=Application("Talk") FOR i=0 to Application("TPlace")-1 Response.Write(""&Temparray(i)) NEXT %> name the page as display.asp. here the message typed by the user is captured in a Application level variable. Then the message is put in an array and is written on to the browser by reading from that array variable. Next open another page and type the following code .. 3. // Message.asp <% IF not Request.Form("message")="" THEN Application.LOCK IF Application("TPlace")>4 THEN Application("TPlace")=0 END IF TempArray=Application("Talk") TempArray(Application("TPlace"))=Request.Form("message") Application("Talk")=TempArray Application("TPlace")=Application("TPlace")+1 Application.Unlock END IF %>