Platforms to show: All Mac Windows Linux Cross-Platform
Back to AtomicDictionaryMBS class.
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Since API 2, Xojo prefers RemoveAll instead of Clear.
AtomicDictionaryMBS.CompareAndSet(key As Variant, expectedValue as Variant, newValue as Variant) as Boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If the value for key matches the expectedValue parameter, this functions set the entry to the new value and returns true. Otherwise it returns false.
This allows you to do a comparison and then exchange if the value matches.
Currently we only compare strings, numbers and booleans by value and others by reference.
AtomicDictionaryMBS.Constructor(Clone as AtomicDictionaryMBS)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
AtomicDictionaryMBS.Constructor(values as Dictionary = nil)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Optionally pass in an existing dictionary to copy the content.
See also:
AtomicDictionaryMBS.ExecuteLocked(theDelegate as DictionaryActionMBS)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
AtomicDictionaryMBS.GetAndSet(key As Variant, newValue as Variant, defaultValue as Variant = nil) as Variant
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
AtomicDictionaryMBS.GetOrSet(key As Variant, defaultValue as Variant = nil) as Variant
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
AtomicDictionaryMBS.HasKey(key As Variant) As Boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
AtomicDictionaryMBS.Increment(key As Variant, Value as Integer = 1) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns the new value.
AtomicDictionaryMBS.Iterator as Iterator
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns AtomicDictionaryIteratorMBS object.
AtomicDictionaryMBS.Key(Index as Integer) as Variant
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Keys are not case-sensitive, but they are encoding-sensitive. If there is no item in the Dictionary at the index passed, a call generates an OutOfBoundsException error.
AtomicDictionaryMBS.Keys as Variant()
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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 or For...Next to loop through all the keys. Keys are not case-sensitive, but they are encoding-sensitive.
AtomicDictionaryMBS.Lookup(key As Variant, defaultValue As Variant = nil) As Variant
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If Key is found, it returns the corresponding value. If key is not found, it returns the passed defaultValue.
AtomicDictionaryMBS.Remove(key As Variant)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If key is not in the Dictionary, it raises a KeyNotFoundException error.
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This invalidates all iterators that were created from the Dictionary.
AtomicDictionaryMBS.SetIfAbsent(key As Variant, Value as Variant) as Boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success or false on failure.
e.g. for a Job queue to add a job, if it isn't already in the queue.
AtomicDictionaryMBS.SetValues(keys() As Variant, values() As Variant)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Both arrays should have the same size.
AtomicDictionaryMBS.Value(key As Variant) As Variant
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If you attempt to read a value for a key that is not in the Dictionary, a KeyNotFoundException error is raised. To avoid the exception, use the Lookup method to provide a default value if the key is not found or use the HasKey method to check if the key exists.
See also:
AtomicDictionaryMBS.Value(key As Variant, Assigns value As Variant)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
AtomicDictionaryMBS.Values as Variant()
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Atomic | MBS Util Plugin | 26.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The order is stable and matches the order returned by Keys at least until the Dictionary 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 Util Plugin.