ASP開(kāi)發(fā)可以使用多種多樣的語(yǔ)法,而且有些是可以同時(shí)使用的,別著急,下面跟著錯(cuò)新技術(shù)頻道小編來(lái)學(xué)習(xí)ASP中if語(yǔ)句、select 、while循環(huán)的使用方法吧。
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title><%="頁(yè)面標(biāo)題"%></title></head><body><%="多條件判斷"%><%response.Write("<br />")response.Write("利用response對(duì)象的Write方法輸出地內(nèi)容!")%><br /><%dim a,ba=200b=300response.Write("兩數(shù)之和為:")response.Write(a+b)response.Write("<br />")if a=100 thenresponse.Write("a=100,第一個(gè)條件滿足。")elseif a=200 thenresponse.Write("a=200,第二個(gè)條件滿足。")elseif a=300 thenresponse.Write("a=300,第三個(gè)條件滿足。")elseresponse.Write("三個(gè)條件都不滿足。")end if%><%response.Write("<br />")dim textnumbertextnumber=200select case textnumber case 100 response.Write("數(shù)值為100, 條件滿足!") case 200 response.Write("數(shù)值為200,條件滿足 !") case 300 response.Write("數(shù)值為300 ,條件滿足!") case else response.Write("以上條件,條件都不滿足!") end select%><%response.Write("<br />")dim i,sumi=0sum=0 while i<=100 sum=sum+i i=i+1wendresponse.Write("100以內(nèi)所有整數(shù)的和為:")response.Write(sum)%><%response.Write("<br />")dim w,sw=0s=0do s=s+ww=w+1loop while w<=100response.Write("100之內(nèi)的所有整數(shù)之和為:")response.Write(s)response.Write("<br/>")response.Write("w的值是:")response.Write(w)%></body></html>
以上就是錯(cuò)新技術(shù)頻道小編給大家整理的ASP中if語(yǔ)句、select 、while循環(huán)的使用方法,通過(guò)js.VeVb.com我們還可以了解到更多專業(yè)知識(shí),希望大家學(xué)習(xí)愉快。
|
新聞熱點(diǎn)
疑難解答
圖片精選