This article mainly introduces the use of if statements, select, and while loops in ASP. Friends who need it can refer to it.
<%@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><%=Page title%></title></head><body><%=Multi-condition judgment%><%response .Write(<br />)response.Write (Use the Write method of the response object to output the content!)%><br /><%dim a,ba=200b=300response.Write(The sum of the two numbers is:)response.Write(a+b)response.Write(<br />)if a=100 thenresponse.Write(a=100, the first condition Satisfied. )elseif a=200 thenresponse.Write(a=200, the second condition is satisfied.)elseif a=300 thenresponse.Write(a=300, the third condition is met.) elseresponse.Write(None of the three conditions are met.)end if%><%response.Write(<br />)dim textnumbertextnumber=200select case textnumber case 100 response.Write (the value is 100, the condition is met!) case 200 response.Write (the value is 200, the condition is met!) case 300 response.Write (the value is 300, the condition is met!) case else response.Write (the above conditions are not met!) end select%><%response.Write(<br />)dim i,sumi=0sum=0 while i<=100 sum=sum+ii=i+1wendresponse.Write(The sum of all integers within 100 is:)response.Write(sum)%><%response.Write(<br />)dim w,sw=0s=0do s= s+ww=w+1loop while w<=100response.Write(The sum of all integers within 100 is:)response.Write(s)response.Write(<br/>)response.Write(The value of w is:)response.Write(w)% ></body></html>
I won’t go into the specific introduction, just look at the examples.