ISStrings.AddAsNameValue

Description

This function adds a pair 'name - value' to the string list.

Syntax

object.AddAsNameValue(aName, aValue)

Part Attribute Type Description
object Required
The object always implements the ISStrings interface
aName In, Required
string
The name of the string
aValue In, Required
string
The value of the string

Return Value

int

Returns the line number of the added string.

Example

Add pairs of name and value and display the value for each name in the list.

Dim aStrings
Dim aMessage 

Set aStrings = Profile.CreateStrings

aStrings.AddAsNameValue "FirstName", "John"
aStrings.AddAsNameValue "Surname", "Smith"

aMessage = aMessage & vbNewLine & vbNewLine & "VALUES : " & vbNewLine
for i = 0 to aStrings.Count - 1
  aName = aStrings.Names(i) 
  aMessage = aMessage & vbNewLine &_
    "  The value of '" & aName & "' is '" & aStrings.Values(aName) & "'"  
next

Profile.MsgBox(aMessage)  
Note:

Version information

Added in v7.8.0