在VB6中使用集合

导入Microsoft Scripting Runtime库
Private Sub CommandButton1_Click()

    Dim d2 As Scripting.Dictionary
    Dim i As Integer
    
    Set d2 = New Scripting.Dictionary
    d2.Add 1, "11111"
    d2.Add 2, "22222"
    d2.Add 3, "33333"
    For i = 0 To d2.Count - 1
        MsgBox d2.item(i + 1)
    Next i
    
    MsgBox "OK"
    
End Sub

你可能感兴趣的:(VB6,vb,scripting,microsoft,integer)