日期:2014-05-17  浏览次数:20945 次

简单聊天室---但报了一个错误好象是数组问题 有人能给指点一下吗?
<%@LANGUAGE= "VBSCRIPT "   CODEPAGE= "936 "%>
<%response.expires=0
response.buffer=true%>
<html> <head> <title> chat </title   > </head>
<body> <center>
<h3> my   chat </h3> </center> <hr>
<%if   request.servervariables( "request_method ")= "POST "   then
if   len(request( "txtname "))   > 0   then
session( "ssname ")=request( "txtname ")
end   if
application.lock
mcounter=application( "gcounter ")
mchars=application( "gchars ")
if   mcounter   > 9   then
mcounter=0
end   if
mchars(mcounter)=session( "ssname ")&   ": "   &   request( "txttalk ")
mcounter=mcounter+1
application( "gcounter ")=mcounter
application( "gchars ")=mchars
application.unlock
end   if   %>
<%
if   application( "gcounter ")=0   then
lstemp=application( "gchars ")(0) '---------------------------------是这的错误我不知道怎样改
else
for   x=0   to   application( "gcounter ")-1
lstemp=lstemp   &   " <br> "   &   application( "gchars ")(x)
next
end   if
response.write   lstemp
%>
<hr> <center>
<form   action= "default.asp "   method=post   name= "aspform ">
<b> <a   href= "default.asp ">
更新显示 </a   > </b>
<h5> 发言:
<input   type= "text "   name= "txttalk "   size= "70 "   > <br>
<h5> 您的姓名:
<input   type= "text "   name= "txtname "   length= "20 "
value= <%=session( "ssname ")%> >
<input   type= "submit "   name= "cmdpost "   default= "true "   value= "发送 ">
</form   > </center   > </body> </html>


错误是:Microsoft   VBScript   运行时错误   (0x800A000D)
类型不匹配:   'application(...) '
/question/default.asp,   第   26   行


------解决方案--------------------
application( "gchars ")这个是数组吗.
是的话用split(application( "gchars "), "数组之间的分隔符 ")(0)