一個ASP中的數組
更新時間:2006年12月25日 00:00:00 作者:
當數據庫中讀取很多的數據。
將他連成了字符串,格式如下:str=1###0###1***2###1###1_1***3###1###1_2***4###2###1_1_1***5###2###1_1_2***6###4###1_1_1_1***7###6###1_1_1_1_1
然后用先用arrResult=split(str,"***")將str分到數組中,接著再對arrResult數組的每條數據用arrTmp=split(arrResult(i),"###")來把他分到數組。
代碼如下:
dim myarry()
arrResult=split(str,"***")
for i=0 to UBound(arrResult)
arrTmp=split(arrResult(i),"###")
for j=0 to UBound(arrTmp)
redim myarry(UBound(arrResult),UBound(arrTmp))
myarry(i,j)=arrTmp(j)
response.Write myarry(i,j)&"<br>"
next
next
當我再
for k=0 to ubound(myarry,1)
response.Write myarry(k,1)&"<br>"
next
想來顯視時,怎么數組中的數據就沒有了呢?
將他連成了字符串,格式如下:str=1###0###1***2###1###1_1***3###1###1_2***4###2###1_1_1***5###2###1_1_2***6###4###1_1_1_1***7###6###1_1_1_1_1
然后用先用arrResult=split(str,"***")將str分到數組中,接著再對arrResult數組的每條數據用arrTmp=split(arrResult(i),"###")來把他分到數組。
代碼如下:
dim myarry()
arrResult=split(str,"***")
for i=0 to UBound(arrResult)
arrTmp=split(arrResult(i),"###")
for j=0 to UBound(arrTmp)
redim myarry(UBound(arrResult),UBound(arrTmp))
myarry(i,j)=arrTmp(j)
response.Write myarry(i,j)&"<br>"
next
next
當我再
for k=0 to ubound(myarry,1)
response.Write myarry(k,1)&"<br>"
next
想來顯視時,怎么數組中的數據就沒有了呢?
相關文章
javascript asp教程第十課--global asa
javascript asp教程第十課--global asa...2007-03-03javascript asp教程第十一課--Application 對象
javascript asp教程第十一課--Application 對象...2007-03-03