ISStrings.IndexOfName

Description

This function returns the index of the name for pair 'name-value'.

Syntax

object.IndexOfName(aName)

Part Attribute Type Description
object Required
The object always implements the ISStrings interface
aName In, Required
string
The name for pair 'name-value'

Return Value

int

Returns the index of the name for the pair 'name-value'.

Example

Display the index of the name for the pair 'name-value'.

Dim aStrings
Dim aName
Dim aMessage 

Set aStrings = Profile.CreateStrings

aStrings.AddAsNameValue " First Name ", " John"
aStrings.AddAsNameValue " Surname ", " Smith"

aMessage = "TEXT : " & vbNewLine & aStrings.Text

aMessage = aMessage & vbNewLine & "NAMES : " & vbNewLine
for i = 0 to aStrings.Count - 1
  aMessage = aMessage & "  Name # " & aStrings.IndexOfName(aStrings.Names(i)) &_
    " = " & aStrings.Names(i) & vbNewLine
next

aMessage = aMessage & vbNewLine & vbNewLine & "VALUES : " & vbNewLine
for i = 0 to aStrings.Count - 1
  aName = aStrings.Names(i) 
  aMessage = aMessage & "  Value #" & aName & " = " & aStrings.Values(aName) &_
  vbNewLine 
next

Profile.MsgBox(aMessage)
Note:

Version information

Added in v7.8.0