好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁 > 知識庫 > asp 動態數組 提供Add、Insert、Remove、RemoveAt、Search等方法。

asp 動態數組 提供Add、Insert、Remove、RemoveAt、Search等方法。

熱門標簽:西寧公司外呼系統平臺 徐州人工智能電銷機器人好用嗎 外呼系統還用卡么 地圖標注宅基地 地圖標注服務哪家好 智能電銷機器人適用于哪些行業 騰訊地圖標注商戶關閉 武漢營銷電話機器人軟件 長沙防封電銷卡品牌
復制代碼 代碼如下:

Class Vector

Private vector_datas()
Private initial_capacity '初始化容量
Private capacity_increment '容量增量
Private element_count '元素數
Private max_capacity '總容量

Private Sub Class_Initialize()
RemoveAll
End Sub

Public Function RemoveAll()
element_count = 0
initial_capacity = 10
capacity_increment = 10
max_capacity = initial_capacity
ReDim vector_datas(initial_capacity)
End Function

Public Property Get Count()
Count = element_count
End Property

Public Property Get Capacity()
Capacity = max_capacity
End Property

Public Property Get InitialCapacity()
InitialCapacity = initial_capacity
End Property

Public Property Get CapacityIncrement()
CapacityIncrement = capacity_increment
End Property

Public Default Property Get Item(index)
If IsObject(vector_datas(index)) Then
Set Item = vector_datas(index)
Else
Item = vector_datas(index)
End If
End Property

Public Function Add(element)
Call Insert(element_count, element)
End Function

Public Function Remove(element)
Dim index
index = Search(element)
RemoveAt(index)
Remove = index
End Function

Public Function RemoveAt(index)
Dim i
For i = index + 1 To element_count - 1 Step 1
Call InternalElement(i - 1, vector_datas(i))
Next
element_count = element_count - 1
If max_capacity - capacity_increment > element_count Then
max_capacity = max_capacity - capacity_increment
ReDim Preserve vector_datas(max_capacity)
End If
End Function

Public Function Search(element)
Dim i
For i = 0 To element_count - 1 Step 1
If vector_datas(i) = element Then
Search = i
Exit Function
End If
Next
Search = -1
End Function

Public Function Insert(index, element)
If index > element_count Then
Err.Raise 20903, "Vector", "Array Index Out Of Bounds.", "", 0
End If
If element_count = 0 Then
Call InternalElement(0, element)
ElseIf index = element_count Then
Call InternalElement(element_count, element)
Else
Dim i
For i = element_count To index + 1 Step -1
Call InternalElement(i, vector_datas(i - 1))
Next
Call InternalElement(index, element)
End If
element_count = element_count + 1
If element_count = max_capacity Then
max_capacity = element_count + capacity_increment
ReDim Preserve vector_datas(max_capacity)
End If
End Function

Public Function SetElementAt(index, element)
If index 0 Or index > element_count - 1 Then
Err.Raise 20903, "Vector", "Array Index Out Of Bounds.", "", 0
End If
Call InternalElement(index, element)
End Function

Private Function InternalElement(index, element)
On Error Resume Next
If IsObject(element) Then
Set vector_datas(index) = element
Else
vector_datas(index) = element
End If
If Err.Number > 0 Then
MsgBox("Vector InternalElement Error: " vbCrLf "Error Source: " Err.Source vbCrLf "Error Number: " Err.Number vbCrLf "Error Description: " Err.Description vbCrLf)
Err.Clear '清除錯誤信息
End If
End Function

Private Sub Class_Terminate() '類銷毀
Erase vector_datas '釋放數組占用的內存, 將每個元素都設為 Nothing
initial_capacity = Empty
capacity_increment = Empty
element_count = Empty
max_capacity = Empty
End Sub

End Class


本文來自CSDN博客,轉載請標明出處:http://blog.csdn.net/o1o2o3o4o5/archive/2009/10/20/4703033.aspx
您可能感興趣的文章:
  • asp取得數組中的最大值的方法
  • asp下使用數組存放數據的代碼
  • asp 得到動態數組中元素的個數
  • asp.net 數組中字符串替換的幾種方式
  • asp.net 字符串、二進制、編碼數組轉換函數
  • asp.net通過js實現Cookie創建以及清除Cookie數組的代碼
  • asp textarea 多行數組分割處理方法
  • asp 數組 重復刪除函數(腳本之家增強版)
  • ASP 過濾數組重復數據函數(加強版)
  • ASP 使用Filter函數來檢索數組的實現代碼
  • asp數組的使用介紹
  • Asp與JS的數組和字符串下標介紹
  • asp中使用redim、preserve創建動態數組實例
  • ASP定義數組方法的技巧

標簽:普洱 運城 通化 荊門 鷹潭 巴彥淖爾 雅安 通遼

巨人網絡通訊聲明:本文標題《asp 動態數組 提供Add、Insert、Remove、RemoveAt、Search等方法。》,本文關鍵詞  asp,動態,數組,提供,Add,Insert,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《asp 動態數組 提供Add、Insert、Remove、RemoveAt、Search等方法。》相關的同類信息!
  • 本頁收集關于asp 動態數組 提供Add、Insert、Remove、RemoveAt、Search等方法。的相關信息資訊供網民參考!
  • 推薦文章