Platforms to show: All Mac Windows Linux Cross-Platform

Back to StringToStringHashMapMBS class.

StringToStringHashMapMBS.AddKeys(targetArray() as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 12.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Similar to keys, but adds keys to the given array.

For older Xojo version 2007/2008 where the plugin can't create an array, so the values and keys function returns always nil.

StringToStringHashMapMBS.AddValues(targetArray() as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 12.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Similar to values, but adds values to the given array.

For older Xojo version 2007/2008 where the plugin can't create an array, so the values and keys function returns always nil.

StringToStringHashMapMBS.Clear

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Erases all of the elements.

StringToStringHashMapMBS.Clone as StringToStringHashMapMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a copy of this map.

StringToStringHashMapMBS.CloneDictionary as Dictionary

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a copy of this map as a dictionary.
Example
dim d as new Dictionary
d.Value("Hello") = "World"

// convert o map
dim m as new StringToStringHashMapMBS(d)
MsgBox str(m.Count)

// convert back
dim o as Dictionary = m.CloneDictionary
MsgBox o.Value("Hello")

StringToStringHashMapMBS.Constructor(CaseSensitive as Boolean = true)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The default constructor.

If CaseSensitive is true, the comparison of texts or strings is case sensitive.

See also:

StringToStringHashMapMBS.Constructor(dic as dictionary, CaseSensitive as Boolean = true)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new map with the keys and values from the dictionary.
Example
dim d as new Dictionary
d.Value("Hello") = "World"

// convert o map
dim m as new StringToStringHashMapMBS(d)
MsgBox str(m.Count)

// convert back
dim o as Dictionary = m.CloneDictionary
MsgBox o.Value("Hello")

See also:

StringToStringHashMapMBS.Constructor(other as StringToStringHashMapMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new map with the keys and values from the existing map.
Example
dim d as new Dictionary
d.Value("Hello") = "World"

// convert o map
dim m as new StringToStringHashMapMBS(d)
MsgBox str(m.Count)

// convert back
dim o as StringToStringHashMapMBS = m.Clone
MsgBox o.Value("Hello")

See also:

StringToStringHashMapMBS.CountKey(key as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Counts how often a key is used in this map.

StringToStringHashMapMBS.find(key as string) as StringToStringHashMapIteratorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Finds the key and returns an interator.

Returns the same value as the last method if the item was not found.

StringToStringHashMapMBS.first as StringToStringHashMapIteratorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns an iterator pointing to the beginning of the map.
Example
// Create a map
dim m as new StringToStringHashMapMBS

m.value("1")="Hello"
m.value("2")="World"
m.value("3")="!"

// get iterators pointing to first and after last element
dim i as StringToStringHashMapIteratorMBS = m.first
dim e as StringToStringHashMapIteratorMBS = m.last

// Show all keys and values
while i.isNotEqual(e)
MsgBox str(i.Key)+" -> "+i.Value
i.MoveNext
wend

StringToStringHashMapMBS.hasKey(key as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns True if Key is in the map and False if it is not. Returns a Boolean.

StringToStringHashMapMBS.Key(index as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the value of key for the Indexth sequential item.

If there is no Indexth item in the map, a call generates an OutOfBoundsException error. The first item has the index zero.

StringToStringHashMapMBS.Keys as string()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns all the keys as an array.
Example
dim m as new StringToStringHashMapMBS

m.Value("1")="Hello"
m.Value("2")="World"

for each v as string in m.Keys
MsgBox str(v)
next

The order is stable and matches the order returned by the Values method at least until the Dictionary is modified. Use this method with For Each to loop through all the keys.

StringToStringHashMapMBS.last as StringToStringHashMapIteratorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns an iterator pointing to the end of the map.
Example
// Create a map
dim m as new StringToStringHashMapMBS

m.value("1")="Hello"
m.value("2")="World"
m.value("3")="!"

// get iterators pointing to first and after last element
dim i as StringToStringHashMapIteratorMBS = m.first
dim e as StringToStringHashMapIteratorMBS = m.last

// Show all keys and values
while i.isNotEqual(e)
MsgBox str(i.Key)+" -> "+i.Value
i.MoveNext
wend

StringToStringHashMapMBS.lookup(key as string, defaultvalue as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Looks up the passed value of Key.
Example
dim map as new StringToStringHashMapMBS

map.value("a")="Hello"
map.value("b")="World"
map.value("c")="!"

MsgBox str(map.lookup("d","?")) // shows "?" as value is missing
MsgBox str(map.lookup("a","?")) // shows "Hello" as value is found

If Key is found, it returns the corresponding value. If Key is not found, it returns the passed defaultValue.

StringToStringHashMapMBS.Operator_Convert as Dictionary

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a copy of the map as dictionary.
Example
dim d as new Dictionary
d.Value("Hello") = "World"

// convert o map
dim m as StringToStringHashMapMBS = d
MsgBox str(m.Count)

// convert back
dim o as Dictionary = m
MsgBox o.Value("Hello")

StringToStringHashMapMBS.Remove(first as StringToStringHashMapIteratorMBS, last as StringToStringHashMapIteratorMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Erases all elements in a range.

See also:

StringToStringHashMapMBS.Remove(key as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Erases the element with the given key.

See also:

StringToStringHashMapMBS.Remove(pos as StringToStringHashMapIteratorMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Erases the element pointed to by the pos iterator.

See also:

StringToStringHashMapMBS.value(key as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Data Types MBS DataTypes Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The value associated with the given key.

If you query for a key which does not exist, a KeyNotFoundException is raised.
(Read and Write computed property)

StringToStringHashMapMBS.ValueAtIndex(index as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the value with the given index.

If there is no Indexth item in the map, a call generates an OutOfBoundsException error. The first item has the index zero.

StringToStringHashMapMBS.Values as string()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Data Types MBS DataTypes Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns all the values as an array
Example
dim m as new StringToStringHashMapMBS

m.Value("1")="Hello"
m.Value("2")="World"

for each v as string in m.Values
MsgBox str(v)
next

The order is stable and matches the order returned by Keys at least until the Map is modified. Use this method with For Each to loop through all the values.

The items on this page are in the following plugins: MBS DataTypes Plugin.


The biggest plugin in space...