Platforms to show: All Mac Windows Linux Cross-Platform

Back to IntegerToVariantOrderedMapMBS class.

IntegerToVariantOrderedMapMBS.AddKeys(targetArray() as Integer)

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.

IntegerToVariantOrderedMapMBS.AddValues(targetArray() as Variant)

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.

IntegerToVariantOrderedMapMBS.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.

IntegerToVariantOrderedMapMBS.Clone as IntegerToVariantOrderedMapMBS

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.

IntegerToVariantOrderedMapMBS.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.

IntegerToVariantOrderedMapMBS.Constructor

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.

See also:

IntegerToVariantOrderedMapMBS.Constructor(dic 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 new map with the keys and values from the dictionary.

See also:

IntegerToVariantOrderedMapMBS.Constructor(other as IntegerToVariantOrderedMapMBS)

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.

See also:

IntegerToVariantOrderedMapMBS.CountKey(key as Integer) 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.

IntegerToVariantOrderedMapMBS.find(key as Integer) as IntegerToVariantOrderedMapIteratorMBS

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.

IntegerToVariantOrderedMapMBS.first as IntegerToVariantOrderedMapIteratorMBS

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 IntegerToVariantOrderedMapMBS

m.value(1)=2
m.value(2)=4
m.value(3)=8

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

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

IntegerToVariantOrderedMapMBS.hasKey(key as Integer) 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.

IntegerToVariantOrderedMapMBS.Key(index as Integer) as Integer

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.

IntegerToVariantOrderedMapMBS.Keys as Integer()

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 IntegerToVariantOrderedMapMBS

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

for each v as Integer 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.

IntegerToVariantOrderedMapMBS.last as IntegerToVariantOrderedMapIteratorMBS

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 IntegerToVariantOrderedMapMBS

m.value(1)=2
m.value(2)=4
m.value(3)=8

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

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

IntegerToVariantOrderedMapMBS.lookup(key as Integer, defaultvalue as Variant) as Variant

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 IntegerToVariantOrderedMapMBS

map.value(10)=1
map.value(100)=2
map.value(1000)=3

MsgBox str(map.lookup(5,0)) // shows 0 as value is missing
MsgBox str(map.lookup(10,0)) // shows 1 as value is found

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

IntegerToVariantOrderedMapMBS.LowerBound(key as Integer) as IntegerToVariantOrderedMapIteratorMBS

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 for the first element whose key is not less than k.

IntegerToVariantOrderedMapMBS.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.

IntegerToVariantOrderedMapMBS.Remove(first as IntegerToVariantOrderedMapIteratorMBS, last as IntegerToVariantOrderedMapIteratorMBS)

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:

IntegerToVariantOrderedMapMBS.Remove(pos as IntegerToVariantOrderedMapIteratorMBS)

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:

IntegerToVariantOrderedMapMBS.UpperBound(key as Integer) as IntegerToVariantOrderedMapIteratorMBS

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 for the first element whose key is greater than k.

IntegerToVariantOrderedMapMBS.value(key as Integer) as Variant

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)

IntegerToVariantOrderedMapMBS.ValueAtIndex(index as Integer) as Variant

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.

IntegerToVariantOrderedMapMBS.Values as Variant()

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
// Create a map
dim m as new IntegerToVariantOrderedMapMBS

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

for each v as Variant in m.Keys
MsgBox 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...