asp数组典型应用代码实例,数组的应用对于提高程序效率,可读性及重用性都用一定的帮助,虽然ASP已经黯淡下来,以.NET,PHP为主导,但很多站还是ASP环境,顺便说句,学.NET赶紧,个人感觉.NET具备明显的优越性!
<table width="100%">
<%
Dim i,j
Dim sql,sql1
Dim Array,Array1
sql1="select id,name from dababase where id=2012 and nane like '%tommmyhu%' order by datetime"
Array=Sql_Array(sql1)
if IsArray(Array) then
For i=0 to Ubound(Array,2)
response.write ("<tr><td style=""line-height:26px;""><strong style=""color:#f60"">"&Array(1,i)&":</strong>")
sql="SELECT id1,name1 FROM database1 WHERE id1="&Array(0,i)&" "
Array1=Sql_Array(sql)
if IsArray(Array1) then
For j=0 to Ubound(Array1,2)
response.write " <a href=""link_"&Array(0,i)&"_"&Array1(2,j)&"_"&Array1(0,j)&"".html"">"&Array1(1,j)&"</a>"
Next
End if
response.write "</td></tr>"
Next
End if
%>
</table>
<table width="100%">
<%
Dim i,j
Dim sql,sql1
Dim Array,Array1
sql1="select id,name from dababase where id=2012 and nane like '%tommmyhu%' order by datetime"
Array=Sql_Array(sql1)
if IsArray(Array) then
For i=0 to Ubound(Array,2)
response.write ("<tr><td style=""line-height:26px;""><strong style=""color:#f60"">"&Array(1,i)&":</strong>")
sql="SELECT id1,name1 FROM database1 WHERE id1="&Array(0,i)&" "
Array1=Sql_Array(sql)
if IsArray(Array1) then
For j=0 to Ubound(Array1,2)
response.write " <a href=""link_"&Array(0,i)&"_"&Array1(2,j)&"_"&Array1(0,j)&"".html"">"&Array1(1,j)&"</a>"
Next
End if
response.write "</td></tr>"
Next
End if
%>
</table>
5点下班
图片上传预览图效果(ASP/ASP.NET版本)


2009/12/25 08:11 | by 
tommyhu:
