最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

在ASP編程中使用數(shù)組

 更新時(shí)間:2006年10月09日 00:00:00   作者:  
數(shù)組的定義
Dim MyArray
MyArray = Array(1,5,123,12,98)

可擴(kuò)展數(shù)組
Dim MyArray()
for i = 0 to 10
ReDim Preserve MyArray(i)
MyArray(i)=i
next

將一個(gè)字符串分割并返回分割結(jié)果的數(shù)組
Dim MyArray
MyArray = Split(tempcnt,chr(13)&chr(10))
For I = Lbound(MyArray) to Ubound(MyArray) 
Response.Write MyArray(I) & "<br>"
Next 

數(shù)組排序函數(shù)
function..Sort(ary) 
KeepChecking = TRUE 
Do Until KeepChecking = FALSE 
KeepChecking = FALSE 
For I = 0 to UBound(ary) 
If I = UBound(ary) Then Exit For 
If ary(I) > ary(I+1) Then 
FirstValue = ary(I) 
SecondValue = ary(I+1) 
ary(I) = SecondValue 
ary(I+1) = FirstValue 
KeepChecking = TRUE 
End If 
Next 
Loop 
Sort = ary 
End function..

數(shù)組排序函數(shù)應(yīng)用例子
Dim MyArray 
MyArray = Array(1,5,123,12,98)
MyArray = Sort(MyArray) 
For I = Lbound(MyArray) to Ubound(MyArray) 
Response.Write MyArray(I) & "<br>"
Next 

在Application和Session中使用數(shù)組
Application.Lock
Application("StoredArray") = MyArray
Application.Unlock

LocalArray = Application("StoredArray")

覆蓋Application中的數(shù)組
Application.Lock
Application("StoredArray") = LocalArray
Application.Unlock

Session使用方法與Application相同

從數(shù)據(jù)庫(kù)中把數(shù)據(jù)導(dǎo)入數(shù)組中
Dim MyArray
取出全部記錄
MyArray = RS.GetRows
取出前10項(xiàng)記錄
MyArray = RS.GetRows(10)

For row = 0 To UBound(MyArray, 2)
For col = 0 To UBound(MyArray, 1)
Response.Write (col, row) & "<br>"
Next
Next

相關(guān)文章

最新評(píng)論

涟水县| 郸城县| 龙川县| 遂昌县| 丁青县| 定陶县| 沙坪坝区| 洞口县| 平武县| 海南省| 扎鲁特旗| 奉节县| 北京市| 泾源县| 卢氏县| 汉源县| 阿合奇县| 沧州市| 红原县| 河北省| 正定县| 静海县| 娱乐| 阳高县| 集贤县| 横峰县| 汉阴县| 贵州省| 巴南区| 胶州市| 鄂伦春自治旗| 宿迁市| 米林县| 浙江省| 西乡县| 吉首市| 吴江市| 柘城县| 买车| 隆化县| 蓬莱市|