This function adds a pair 'name - value' to the string list.
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 |
int
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)