數(shù)組的定義 Dim MyArray MyArray = Array(1,5,123,12,98)
可擴展數(shù)組 Dim MyArray() for i = 0 to 10 ReDim Preserve MyArray(i) MyArray(i)=i next
將一個字符串分割并返回分割結(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