59 lines
1.3 KiB
Text
59 lines
1.3 KiB
Text
' Gambas class file
|
|
|
|
Export
|
|
' The TestParameters class is the collection class for TestParameter objects.
|
|
|
|
'Member variables
|
|
Private m_colParameters As Collection
|
|
|
|
'Initialize variables
|
|
Public Sub _new()
|
|
|
|
m_colParameters = New Collection
|
|
|
|
End Sub
|
|
|
|
' Adds an instance of a TestParameter object to the collection
|
|
Public Sub AddParameter(oParameter As TestParameter)
|
|
|
|
m_colParameters.Add(oParameter, oParameter.Name)
|
|
|
|
End Sub
|
|
|
|
' Creates a new TestParameter object and adds it to the collection.
|
|
Public Function Add(sName As String, vValue As Variant) As TestParameter
|
|
|
|
Dim oParameter As New TestParameter
|
|
|
|
With oParameter
|
|
.Name = sName
|
|
.Value = vValue
|
|
End With
|
|
AddParameter(oParameter)
|
|
Return oParameter
|
|
|
|
End Function
|
|
|
|
' Return number of TestParameter objects in the collection.
|
|
Public Function Count() As Long
|
|
|
|
Return m_colParameters.Count
|
|
|
|
End Function
|
|
|
|
' Return a TestParameter object from the collection by name or index
|
|
Public Function Item(vIndex As Variant) As TestParameter
|
|
|
|
'Attribute Item.VB_UserMemId = 0
|
|
Return m_colParameters(vIndex)
|
|
|
|
End Function
|
|
|
|
' Allows enumeration of the collection using For...Each
|
|
|
|
'fixme enum
|
|
' Public Property Get NewEnum() As IUnknown
|
|
' Attribute NewEnum.VB_UserMemId = -4
|
|
' Attribute NewEnum.VB_MemberFlags = "40"
|
|
' Set NewEnum = m_colParameters.[_NewEnum]
|
|
' End Property
|