一個ASP中的數(shù)組
更新時間:2006年12月25日 00:00:00 作者:
當數(shù)據(jù)庫中讀取很多的數(shù)據(jù)。
將他連成了字符串,格式如下: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分到數(shù)組中,接著再對arrResult數(shù)組的每條數(shù)據(jù)用arrTmp=split(arrResult(i),"###")來把他分到數(shù)組。
代碼如下:
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
想來顯視時,怎么數(shù)組中的數(shù)據(jù)就沒有了呢?
將他連成了字符串,格式如下: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分到數(shù)組中,接著再對arrResult數(shù)組的每條數(shù)據(jù)用arrTmp=split(arrResult(i),"###")來把他分到數(shù)組。
代碼如下:
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
想來顯視時,怎么數(shù)組中的數(shù)據(jù)就沒有了呢?
相關文章
ASP字符串大寫轉換成小寫 ASP小寫轉換成大寫 ucase lcase
字符串大寫字面轉換成小寫字面或者小寫字面轉換成大寫字面,ASP(特指VBS)里自帶了兩個函數(shù)2009-06-06
asp實現(xiàn)批量錄入數(shù)據(jù)的實現(xiàn)
asp實現(xiàn)批量錄入數(shù)據(jù)的實現(xiàn)...2006-12-12

