一個(gè)ASP中的數(shù)組
更新時(shí)間:2006年12月25日 00:00:00 作者:
當(dāng)數(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ù)組中,接著再對(duì)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
當(dāng)我再
for k=0 to ubound(myarry,1)
response.Write myarry(k,1)&"<br>"
next
想來顯視時(shí),怎么數(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ù)組中,接著再對(duì)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
當(dāng)我再
for k=0 to ubound(myarry,1)
response.Write myarry(k,1)&"<br>"
next
想來顯視時(shí),怎么數(shù)組中的數(shù)據(jù)就沒有了呢?
相關(guān)文章
ASP編程入門進(jìn)階(十):Global.asa文件
ASP編程入門進(jìn)階(十):Global.asa文件...2007-01-01如何遠(yuǎn)程調(diào)用ACCESS數(shù)據(jù)庫[要求加精!!]
如何遠(yuǎn)程調(diào)用ACCESS數(shù)據(jù)庫[要求加精??!]...2006-06-06javascript asp教程第十課--global asa
javascript asp教程第十課--global asa...2007-03-03javascript asp教程第十一課--Application 對(duì)象
javascript asp教程第十一課--Application 對(duì)象...2007-03-03