51代码网ORACLEMYSQLSQL SERVER其它数据库java/jspasp/asp.netC/C++/VC++APP应用其它语言服务器应用
您现在的位置: 51代码网 >> asp.net >> 文章正文

编代码的时候为什么不能用回车键

更新时间:2012-5-3:  来源:51代码网

为什么在编代码的时候不能用回车键啊。用了就报错。比如<%if()then() end if%>这样了在end if前面打了个回车就出错了怎么回事啊
<%if()then() 
end if%>
还有 <%if ( (rs("t_expire")<date()) and (rs("t_commend")=0) ) then response.write ("a") elseif ((rs("t_expire")>=date()) and( rs("t_commend")=0)) then response.write ("b") elseif (rs("t_commend")=1) then response.write ("c") end if %>这段代码写错了吗 去掉两个elseif没错加上就一直出错,老说语句未结束。结束了啊。求哪位大哥帮帮忙,小弟拜谢!!
回复:<%if()then() end if%>
是不是后面不能用括号。。而是直接写语句就OK。。
if then 写在一行的时候不加end if,写多行的时候才要加end if
  If xx Then xx
或者

if xx then
xxx
end if

同理,if else 也是一样,写在一行就不用加end if,写多行必须
if xx then xx else xx

if xx then
xx
else
xx
end if

  • 上一篇文章:
  • 下一篇文章: 没有了
  • 赞助商链接
    推荐文章
  • 此栏目下没有推荐文章
  • {
    设为首页 | 加入收藏 | 友情链接 | 网站地图 | 联系站长 |