<%@Language = "VBScript"%> <% Option Explicit Response.Buffer = True Response.Expires = -1000 Dim vRoomNo Dim vPrivateMessage vRoomNo = Session("RoomNo") vPrivateMessage = Trim(Request.Form("PrivateMessage")) If vPrivateMessage <> "" Then Application.Lock AddLineToChat("/msg " & Request.Form("UserName") & " " & Session("ChatName") & ": " & vPrivateMessage) AddLineToChat("/msg " & Session("ChatName") & " " & Request.Form("UserName") & ": " & vPrivateMessage) End If Response.Write "Result=OK" Application.Unlock Response.Flush Response.End Sub AddLineToChat(ByVal vNewLine) Dim vCurrentLine, vChatLines, vMaxLines vCurrentLine = Application("ChatLineCount" & vRoomNo) vChatLines = Application("ChatLines" & vRoomNo) vMaxLines = Application("ChatMaxLines" & vRoomNo) vCurrentLine = vCurrentLine + 1 If vCurrentLine > vMaxLines Then vMaxLines = vMaxLines + 500 If vCurrentLine = 1 Then Redim vChatLines(vMaxLines) Else Redim Preserve vChatLines(vMaxLines) End If Application("ChatMaxLines" & vRoomNo) = vMaxLines End If vChatLines(vCurrentLine - 1) = vNewLine Application("ChatLines" & vRoomNo) = vChatLines Application("ChatLineCount" & vRoomNo) = vCurrentLine End Sub %>