VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject END Attribute VB_Name = "Splitter" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = False Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes" Attribute VB_Ext_KEY = "Collection" ,"SuperString" Attribute VB_Ext_KEY = "Member0" ,"SuperString" Attribute VB_Ext_KEY = "Top_Level" ,"Yes" 'local variable to hold collection Private mCol As Collection Public Sub Add(StringExpression As Variant) 'create a new object Dim objNewMember As SuperString Dim i As Integer If IsArray(StringExpression) Then For i = LBound(StringExpression) To UBound(StringExpression) Set objNewMember = New SuperString objNewMember.StringExpression = CStr(StringExpression(i)) objNewMember.Index = mCol.Count + 1 mCol.Add objNewMember Set objNewMember = Nothing Next Else Set objNewMember = New SuperString objNewMember.StringExpression = CStr(StringExpression(0)) objNewMember.Index = mCol.Count + 1 mCol.Add objNewMember Set objNewMember = Nothing End If ' written by IWiz mity@ropnet.ru End Sub Public Property Get Item(vntIndexKey As Variant) As SuperString Attribute Item.VB_UserMemId = 0 'used when referencing an element in the collection 'vntIndexKey contains either the Index or Key to the collection, 'this is why it is declared as a Variant 'Syntax: Set foo = x.Item(xyz) or Set foo = x.Item(5) Set Item = mCol(vntIndexKey) ' written by IWiz mity@ropnet.ru End Property Public Property Get Count() As Long 'used when retrieving the number of elements in the 'collection. Syntax: Debug.Print x.Count Count = mCol.Count ' written by IWiz mity@ropnet.ru End Property Public Sub Remove(vntIndexKey As Variant) 'used when removing an element from the collection 'vntIndexKey contains either the Index or Key, which is why 'it is declared as a Variant 'Syntax: x.Remove(xyz) Dim i As Integer mCol.Remove vntIndexKey For Each xobj In mCol i = i + 1 xobj.Index = i Next ' written by IWiz mity@ropnet.ru End Sub Public Property Get NewEnum() As IUnknown Attribute NewEnum.VB_UserMemId = -4 Attribute NewEnum.VB_MemberFlags = "40" 'this property allows you to enumerate 'this collection with the For...Each syntax Set NewEnum = mCol.[_NewEnum] ' written by IWiz mity@ropnet.ru End Property Private Sub Class_Initialize() 'creates the collection when this class is created Set mCol = New Collection ' written by IWiz mity@ropnet.ru End Sub Private Sub Class_Terminate() 'destroys collection when this class is terminated Set mCol = Nothing ' written by IWiz mity@ropnet.ru End Sub Public Function AllNotEmpty() As Boolean Dim xobj As SuperString AllNotEmpty = True For Each xobj In mCol If xobj.StringExpression = "" Then AllNotEmpty = False Exit For End If Next ' written by IWiz mity@ropnet.ru End Function