Platforms to show: All Mac Windows Linux Cross-Platform
Back to JSONMBS class.
JSONMBS.Add(Value as Variant) New in 23.5
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) New in 23.5
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) New in 23.5
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.Child(index As Integer) as JSONMBS New in 23.5
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If the self is an empty object, we replace it with an empty array and add the value.
Same as ChildAt method
Raises exception if index is out of range.
(Read and Write computed property)
See also:
JSONMBS.Child(Key As String) as JSONMBS New in 23.5
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If the self is an empty array, we replace it with an empty object and add the value.
Raises an exception if the value is not found.
(Read and Write computed property)
See also:
JSONMBS.ChildAt(index As Integer) as JSONMBS New in 23.5
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If the self is an empty object, we replace it with an empty array and add the value.
Same as ChildAt method.
Raises exception if index is out of range.
(Read and Write computed property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Removes all entries from array or object.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | JavaScript Object Notation | MBS Util Plugin | 16.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | JavaScript Object Notation | MBS Util Plugin | 16.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
No need to call this as destructor does the same.
But this call allows you to release circular references.
JSONMBS.Compare(Other as JSONMBS) as Integer New in 23.5
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns 0 if both are equal, 1 if bigger and -1 if smaller.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | JavaScript Object Notation | MBS Util Plugin | 13.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
JSONMBS.Constructor(dic As Dictionary) New in 23.5
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Converts all dictionary values to JSON objects internally.
See also:
JSONMBS.Constructor(JSONString as String) New in 23.5
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Text should be UTF-8.
Raises an exception in case of error.
See also:
JSONMBS.Constructor(other as JSONMBS) New in 23.5
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Makes a copy of all the nodes.
See also:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | JavaScript Object Notation | MBS Util Plugin | 19.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Depending on the JSON content, you get variants containing values (string, double, boolean or nil), dictionaries or array of variants.
Dictionary is not case sensitive, so may not work correctly if you have duplicate keys with only different in case.
See also:
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() New in 23.5
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 New in 23.5
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 New in 23.5
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.
The items on this page are in the following plugins: MBS Util Plugin.
