Platforms to show: All Mac Windows Linux Cross-Platform
Back to JSONMBS class.
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Variant is converted to JSONMBS if needed.
If the self is an empty object, we replace it with an empty array and add the value.
Same as Add method.
JSONMBS.AddAt(index As Integer, value As Variant)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Variant is converted to JSONMBS if needed.
If the self is an empty object, we replace it with an empty array and insert the value.
Same as Insert method.
JSONMBS.AddItemToArray(item as JSONMBS)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 13.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If you add item from new nodes created with plugin, we add them to the tree.
If you add items from existing node from other JSON tree, we add references.
Some examples using this method:
JSONMBS.AddItemToObject(label as string, value as JSONMBS)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 13.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If you add item from new nodes created with plugin, we add them to the tree.
If you add items from existing node from other JSON tree, we add references.
Some examples using this method:
JSONMBS.AddOrReplaceItemToObject(label as string, value as JSONMBS)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 22.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Same as AddItemToObject, but removes old item for the label if it exists.
JSONMBS.Append(Value as Variant)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Variant is converted to JSONMBS if needed.
If the self is an empty object, we replace it with an empty array and add the value.
Same as Add method.
JSONMBS.ArrayItem(index as integer, Clone as Boolean = false) as JSONMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 13.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Added Clone parameter for version 20.4.
If Clone is true, we duplicate the JSON, so the new JSONMBS object does not point to origin JSONMBS object and exist independent.
Some examples using this method:
JSONMBS.ArrayItems(Clone as Boolean = false) as JSONMBS()
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 20.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If Clone is true, we duplicate the JSON, so the new JSONMBS objects do not point to origin JSONMBS object and exist independent.
Some examples using this method:
JSONMBS.DeleteItem(index as Integer)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 19.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Index is zero based.
See also:
JSONMBS.DeleteItem(label as string)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 19.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
JSONMBS.Entries as JSONEntryMBS()
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Convenience function to get all entries.
Converts values to variants as needed.
Works for both objects and arrays.
JSONMBS.Equals(Other as JSONMBS) as Boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 19.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
We compare recursively all nodes.
If structure and values are the same, we return true, otherwise false.
Objects do not need to have same order for entries.
JSONMBS.FilterObjectArray(Name as String, Other as JSONMBS) as JSONMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Similar as if you loop and look for index of matching items with FindValueInObjectArray and transfer it yourself to a new array.
JSONMBS.FindValueInArray(Other as JSONMBS, StartIndex as Integer = 0) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns zero based index or -1 if not found.
Version 20.0 or newer allows with ByContent parameter = true to find by content, so number can be found via text.
StartIndex parameter added in version 21.5: Index of first element to check. Zero if not specified.
If you like to continue searching, you can pass last result + 1.
JSONMBS.FindValueInObjectArray(Name as String, Other as JSONMBS, StartIndex as Integer = 0) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns zero based index or -1 if not found.
We look into each object in the array, check if it has a value for the given label and compare that to the one to find.
Version 20.0 or newer allows with ByContent parameter = true to find by content, so number can be found via text.
StartIndex parameter added in version 21.5: Index of first element to check. Zero if not specified.
If you like to continue searching, you can pass last result + 1.
JSONMBS.HasChild(label as string) as Boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true if the entry exists or false if not.
Only for objects, not arrays.
Same as HasKey and HasName methods.
JSONMBS.HasKey(Key as string) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true if the entry exists or false if not.
Only for objects, not arrays.
Same as HasChild and HasName methods.
JSONMBS.HasName(Name as string) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true if the entry exists or false if not.
Only for objects, not arrays.
Same as HasKey and HasChild methods.
Some examples using this method:
JSONMBS.Insert(index as integer, value as variant)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Variant is converted to JSONMBS if needed.
If the self is an empty object, we replace it with an empty array and insert the value.
Same as AddAt method.
JSONMBS.Iterate as JSONIteratorMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Provides JSONMBS objects for inspection.
Warning: If you iterate while the JSONMBS is changed you may skip some entries or get duplicates, so please avoid editing it while iterating.
JSONMBS.IterateEntries as JSONIteratorMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Entries are provided with JSONEntryMBS objects and include key and value.
For arrays, the key name is the index value.
Warning: If you iterate while the JSONMBS is changed you may skip some entries or get duplicates, so please avoid editing it while iterating.
JSONMBS.IterateValues as JSONIteratorMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The values are provided and converted to variant.
Warning: If you iterate while the JSONMBS is changed you may skip some entries or get duplicates, so please avoid editing it while iterating.
JSONMBS.KeyAt(index As Integer) as String
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Raises an exception if index is out of range.
Same as Name or NameAt methods.
The order of keys can change if you add/remove values in the JSON object.
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The order is as stored in memory currently and that order changes if you edit the JSON object.
We cache the array so multiple calls would return the same array and you should not modify it.
Same as Names method.
The items on this page are in the following plugins: MBS Util Plugin.