asp if 使用格式

来源:百度知道 编辑:UC知道 时间:2024/09/21 08:15:29
比如当If Then 后只有一个句话时就可以不用End if 而如果这句话是
if ur.eof then exit for 就可以写成一行
而如果是 if () then response.write(""); 就必须写成
if () then
response.write("") ;
否则则报错
我想知道更详细的诸如此类的if使用格式和注意事项
能有原因更好 如果答案让我满意我加分

Asp没有分号 ";"

一句话可实现的话可以在一行内完成,而且不需要end if

if 语句也算挺灵活
if () then response.write "asdasd" 这个是可行的
诸如此类的如
if () then response.end
之类的 很多
但是还是推荐你多行来完成。带end if
这样可以使你的程序看着更直观些

还有就是 if 后面 只要有回车换行 那么就必须要有end if

也可以写成
if () then
response.write "asdasd"
end if

建立个asp页面
<%
If request("aa")="" Then response.write "asd<br />"
%>
<%
If request("aa")="" Then
response.write "asd"
end if
%>
输入以上两句 结果是可行的....

exit for 用于 跳出for 循环的,跟条件语句不答嘎

条件if 的语句格式有
1.
if true then

end if

2.
if true then

else

end if

3
if true then

elseif xx then

else

end if