method IndexOf(Name: String): Number
Available for StringList Objects. Returns the Index of the first item in the list with a key of Name.
IndexOfName method syntax has these named arguments:
Parameter |
Description |
|---|---|
Name |
Required. The key to return the index number of in the list. |
For example:
Dim StringList as Object
StringList = CreateObject("Accredo.StringList")
StringList.AddPair("A", "Alpha")
StringList.AddPair("B", "Beta")
StringList.AddPair("G", "Gamma")
StringList.AddPair("Z", "Zeta")
Msgbox(StringList.IndexOfName("g"))
will return 2, as this is the index of first instance of the key "g" in the list.