国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > VBScript > 正文

VBS ArrayList Class vbs中的數組類

2019-10-26 17:59:14
字體:
來源:轉載
供稿:網友
Class ArrayList
 Private items()
 Private size

  Private Sub Class_Initialize
 size = 0
 ReDim items(1)
  End Sub

  Private Sub Class_Terminate
 items = null
  End Sub

 Public Function Add(ByVal value)
       If (size = Ubound(items)) Then EnsureCapacity((size + 1))

       items(size) = value
       size = size + 1
       Add = size
 End Function

 Public Property Get Item(index)
  Item = items(index)
 End Property

 Public Property Let Item(index, vObject)
  items(index) = vObject
 End Property

 Property Get Count
  Count = size
 End Property


 Public Property Get Capacity()
  Capacity = Ubound(items)
 End Property

 Public Property Let Capacity(value)
            If (value <> Ubound(items)) Then
                  If (value < size) Then Err.Rise 6

                  If (value > 0) Then
                        ReDim Preserve items(value)
                  Else
                        ReDim Preserve items(3)
                  End If
            End If
 End Property

 Private Sub EnsureCapacity(ByVal min)
       If (Ubound(items) < min) Then
      Dim num1 : num1 = IIf((Ubound(items) = 0), 4, (Ubound(items) * 2))
      If (num1 < min) Then num1 = min
      Capacity = num1
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 那曲县| 静乐县| 麻阳| 右玉县| 鄄城县| 太谷县| 陆丰市| 石阡县| 六盘水市| 江山市| 金湖县| 抚州市| 兴和县| 迁西县| 天长市| 清河县| 封开县| 华坪县| 凌海市| 华阴市| 黄石市| 大田县| 喀喇沁旗| 泰兴市| 屯昌县| 宜君县| 阜康市| 凤翔县| 乐昌市| 永年县| 荔波县| 吉水县| 任丘市| 苗栗县| 册亨县| 明溪县| 宿迁市| 元氏县| 东光县| 黑水县| 常宁市|