ISStrings.IndexOf

Description

This function returns the index of the string in the list.

Syntax

object.IndexOf(aItem)

Part Attribute Type Description
object Required
The object always implements the ISStrings interface
aItem In, Required
string
The string value

Return Value

int

Returns the index of the string in the list.

Example

Display the string list as the text and the index of the specified item.

Dim aStrings
Dim aIndex
Dim aMessage 

Set aStrings = Profile.CreateStrings

aStrings.Add "Red"
aStrings.Add "Green"
aStrings.Add "Blue"
aStrings.Add "Black"

aIndex = aStrings.IndexOf("Green") 

aMessage = "TEXT : " & vbNewLine & aStrings.Text & vbNewLine &_
  "LINE INDEX: " & aIndex

Profile.MsgBox(aMessage)
Note:

Version information

Added in v7.8.0