构造字符串的时候出错?
函数:
Function SubBoard(bid)
if bid = " " or isnull(bid) then
Exit Function
else
set rs1 = Server.CreateObject( "adodb.recordset ")
rs1.open "select * from suboard where bid = ' " & bid & " ' order by paixu ",conn,1,1
if not rs1.eof then
do while not rs1.eof
SubBoard = SubBoard & " <tr height= '30 '> <td align= 'center ' valign= 'middle ' bgcolor= '#FFFFFF '> "
if isNew(rs1( "subid ")) = 0 then
SubBoard = SubBoard & " <img src= '../images/index_46.jpg ' width= '20 ' height= '19 '> " //else
//SubBoard = SubBoard & " <img src= '../images/index_43.jpg ' width= '20 ' height= '19 '> "
end if
SubBoard = SubBoard & " </td> <td align= 'center ' valign= 'middle ' bgcolor= '#FFFFFF '> <a href= 'main.asp?bid= "&rs1( "bid ")& "&subid= "&rs1( "subid ")& " '> <strong> " & rs1( "suboard ") & " </strong> </a> </td> " & Detail(rs1( "subid ")) & " <td align= 'center ' valign= 'middle ' bgcolor= '#FFFFFF ' colspan= '4 '> " & Articles(rs1( "subid ")) & " </td> "
rs1.movenext
loop
else
exit Function
end if
end if
End Function
那开头的//,如果去掉,会提示出错:错误
Microsoft VBScript 编译器错误 (0x800A0412)
必须是行中的第一个语句
/ichild_bbs/bbs/lib_test.asp, line 173, column 88
SubBoard = SubBoard & " <img src= '../images/index_46.jpg ' width= '20 ' height= '19 '> " else
---------------------------------------------------^
如果注释的话,就不会出错..
应该怎么修改呢?谢谢!
------解决方案--------------------else不是在一行的?