Platforms to show: All Mac Windows Linux Cross-Platform

Back to JSONMBS class.

JSONMBS.ArraySize as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries size of array.

For objects returns number of keys.
Same as Count property.
(Read only property)

Some examples using this property:

JSONMBS.ChildNode as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The first child node.
Example
dim o as JSONMBS = JSONMBS.NewArrayNode

o.AddItemToArray JSONMBS.NewNumberNode(1)
o.AddItemToArray JSONMBS.NewNumberNode(2)
o.AddItemToArray JSONMBS.NewNumberNode(3)
o.AddItemToArray JSONMBS.NewNumberNode(4)

dim n as JSONMBS = o.ChildNode // first child
MsgBox n.ValueString // shows 1

Please move to newer iterator functions instead.
(Read only property)

Some examples using this property:

JSONMBS.Compact as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether to prefer compact output for toString property.
Example
Dim j As New JSONMBS
j.Value("Hello") = "World"

Dim s As String = j.toString
j.compact = false
Dim f As String = j.toString

Break // see difference?

Default is true.
Set to false to get formatted output.
Or call ToString method with parameter.
(Read and Write property)

JSONMBS.Count as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries size of array.
Example
Dim o As New JSONMBS

o.add 1
o.add 2
o.add 3

MessageBox o.Count.ToString // shows 3

For objects returns number of keys.
Same as ArraySize property.
(Read only property)

JSONMBS.Handle as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The internal handle to the JSON object.

It is possible to have two Xojo objects with the same handle pointing to the same JSON node.
(Read only property)

JSONMBS.IsArray as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 21.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether this object represents an array.

Returns true if type is kTypeArray.
(Read only property)

JSONMBS.IsBoolean as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 21.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether this object represents a boolean value.

Returns true if type is kTypeTrue or kTypeFalse.
(Read only property)

JSONMBS.IsEmpty as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether the value is empty.
Example
Dim j As New JSONMBS

Dim empty1 As Boolean = j.IsEmpty // true

j.Value("hello") = "world"

Dim empty2 As Boolean = j.IsEmpty // false

Break

Whether a string, array or object is empty and has no content.
Boolean or numerical values are not empty.
(Read only property)

JSONMBS.IsInt32 as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether this is an 64-bit integer number.
Example
Dim j1 As JSONMBS = JSONMBS.NewNumberNode(1234)
Dim j2 As JSONMBS = JSONMBS.NewNumberNode(1234.4)
Dim j3 As JSONMBS = JSONMBS.NewNumberNode(12343456789435234523)
Dim j4 As JSONMBS = JSONMBS.NewNumberNode(-6578904953445453)
dim j5 as JSONMBS = JSONMBS.NewStringNode("Hello")

Dim b1 As Boolean = j1.IsInt32 // okay
Dim b2 As Boolean = j2.IsInt32 // has decimals
Dim b3 As Boolean = j3.IsInt32 // too big
Dim b4 As Boolean = j4.IsInt32 // too small
Dim b5 As Boolean = j5.IsInt32 // is string

Break

Returns true if

  • it is type number
  • it is in the range for int32.
  • it is not with decimal digits after the dot.
(Read only property)

JSONMBS.IsInt64 as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether this is an 64-bit integer number.
Example
Dim j1 As JSONMBS = JSONMBS.NewNumberNode(1234)
Dim j2 As JSONMBS = JSONMBS.NewNumberNode(1234.4)
Dim j3 As JSONMBS = JSONMBS.NewNumberNode(1234345673389435234523.0)
Dim j4 As JSONMBS = JSONMBS.NewNumberNode(-657890493333353445453.0)
Dim j5 As JSONMBS = JSONMBS.NewStringNode("Hello")

Dim b1 As Boolean = j1.IsInt64 // okay
Dim b2 As Boolean = j2.IsInt64 // has decimals
Dim b3 As Boolean = j3.IsInt64 // too big
Dim b4 As Boolean = j4.IsInt64 // too small
Dim b5 As Boolean = j5.IsInt64 // is string

Break

Returns true if

  • it is type number
  • it is in the range for int64.
  • it is not with decimal digits after the dot.
(Read only property)

JSONMBS.IsNull as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 21.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether this object represents a NULL value.

Returns true if type is kTypeNull.
(Read only property)

JSONMBS.IsNumber as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 21.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether this object represents a numberic value.

Returns true if type is int64, uint64, half or double.
If type is string, we check semantic tag and return true for big decimal, big int, big float ot float 128bit, so this is a numeric type.
(Read only property)

JSONMBS.IsObject as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 21.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether this object represents an object.

Returns true if type is kTypeObject.
(Read only property)

JSONMBS.IsUInt32 as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether this is an 32-bit unsigned integer number.
Example
Dim j1 As JSONMBS = JSONMBS.NewNumberNode(1234)
Dim j2 As JSONMBS = JSONMBS.NewNumberNode(1234.4)
Dim j3 As JSONMBS = JSONMBS.NewNumberNode(12343456789435234523)
Dim j4 As JSONMBS = JSONMBS.NewNumberNode(-6578904953445453)
dim j5 as JSONMBS = JSONMBS.NewStringNode("Hello")

Dim b1 As Boolean = j1.IsUInt32 // okay
Dim b2 As Boolean = j2.IsUInt32 // has decimals
Dim b3 As Boolean = j3.IsUInt32 // too big
Dim b4 As Boolean = j4.IsUInt32 // too small
Dim b5 As Boolean = j5.IsUInt32 // is string

Break

Returns true if

  • it is type number
  • it is in the range for uint32.
  • it is not with decimal digits after the dot.
(Read only property)

JSONMBS.IsUInt64 as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether this is an 64-bit unsigned integer number.
Example
Dim j1 As JSONMBS = JSONMBS.NewNumberNode(1234)
Dim j2 As JSONMBS = JSONMBS.NewNumberNode(1234.4)
Dim j3 As JSONMBS = JSONMBS.NewNumberNode(1234345673389435234523.0)
Dim j4 As JSONMBS = JSONMBS.NewNumberNode(-657890493333353445453.0)
Dim j5 As JSONMBS = JSONMBS.NewStringNode("Hello")

Dim b1 As Boolean = j1.IsUInt64 // okay
Dim b2 As Boolean = j2.IsUInt64 // has decimals
Dim b3 As Boolean = j3.IsUInt64 // too big
Dim b4 As Boolean = j4.IsUInt64 // too small
Dim b5 As Boolean = j5.IsUInt64 // is string

Break

Returns true if

  • it is type number
  • it is in the range for uint64.
  • it is not with decimal digits after the dot.
(Read only property)

JSONMBS.LastChildNode as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The last child node.
Example
dim o as JSONMBS = JSONMBS.NewArrayNode

o.AddItemToArray JSONMBS.NewNumberNode(1)
o.AddItemToArray JSONMBS.NewNumberNode(2)
o.AddItemToArray JSONMBS.NewNumberNode(3)
o.AddItemToArray JSONMBS.NewNumberNode(4)

dim k as JSONMBS = o.LastChildNode
MsgBox k.ValueString // shows 4

(Read only property)

Some examples using this property:

JSONMBS.LastRowIndex as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries last row index.
Example
Dim j As New JSONMBS

j.add 1
j.add 2
j.add 3

MessageBox j.LastRowIndex.ToString // shows 2

Same as Count-1.
(Read only property)

JSONMBS.Name as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The name of this node.

(Read only property)

See also:

JSONMBS.NextNode as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The next node on the same level.
Example
dim o as JSONMBS = JSONMBS.NewArrayNode

o.AddItemToArray JSONMBS.NewNumberNode(1)
o.AddItemToArray JSONMBS.NewNumberNode(2)
o.AddItemToArray JSONMBS.NewNumberNode(3)
o.AddItemToArray JSONMBS.NewNumberNode(4)

dim k as JSONMBS = o.ChildNode
while k<>nil
MsgBox k.ValueString // shows 1, 2, 3, 4

k=k.NextNode
wend

Please move to newer iterator functions instead.
(Read only property)

JSONMBS.PreviousNode as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The previous node on the same level.
Example
dim o as JSONMBS = JSONMBS.NewArrayNode

o.AddItemToArray JSONMBS.NewNumberNode(1)
o.AddItemToArray JSONMBS.NewNumberNode(2)
o.AddItemToArray JSONMBS.NewNumberNode(3)
o.AddItemToArray JSONMBS.NewNumberNode(4)

dim k as JSONMBS = o.LastChildNode
while k<>nil
MsgBox k.valuestring // shows 4, 3, 2, 1

k=k.PreviousNode
wend

Please move to newer iterator functions instead.
(Read only property)

JSONMBS.Root as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The root object.

The root node owns the references to all children.
(Read only property)

JSONMBS.Tag as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The semantic tag.

This can give a value as more detailed meaning on the usage.
e.g. we often have strings to hold numbers to preserve all digits.
(Read only property)

JSONMBS.toString as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 14.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Produces a JSON markup text document from a document tree.
Example
dim o as JSONMBS = JSONMBS.NewObjectNode

o.AddItemToObject "text", JSONMBS.NewStringNode("Hello World")

MsgBox o.toString // shows "{"text":"Hello World"}"

Returns "" on any error. Lasterror is set.
(Read only property)

See also:

JSONMBS.Type as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The type of the node.
Example
dim n as JSONMBS = JSONMBS.NewNullNode

MsgBox str(n.Type)

(Read only property)

JSONMBS.TypeName as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Shows type of this node as string.
Example
dim o as JSONMBS = JSONMBS.NewArrayNode
MsgBox o.TypeName

This property was added for debugging so you can see type in debugger.
(Read only property)

JSONMBS.Valid as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 16.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Checks whether node is valid.

The handle is not zero and there are no error nodes in JSON tree.
Returns true if valid, else false.
(Read only property)

JSONMBS.Value as Variant

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries the value of this JSON.
Example
Dim j1 As JSONMBS = JSONMBS.NewStringNode("Hello World")
Dim v1 As Variant = j1.Value
Dim j2 As JSONMBS = JSONMBS.NewNumberNode(123)
Dim v2 As Variant = j2.Value
Dim j3 As JSONMBS = JSONMBS.NewNumberNode("1234.567")
Dim v3 As Variant = j3.Value
Dim j4 As JSONMBS = JSONMBS.NewCurrencyNode(123.4567)
Dim v4 As Variant = j4.Value

Break

Converts value to variant.
(Read only property)

See also:

JSONMBS.ValueBoolean as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 17.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The boolean value of this json node.

Returns true if type is kTypeTrue, false if kTypeFalse or true if ValueInteger <> 0.
(Read only property)

Some examples using this property:

JSONMBS.ValueByteString as MemoryBlock

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries byte string as MemoryBlock
Example
Dim mem As MemoryBlock = "Hello World"

// we send a MemoryBlock into our JSON
Dim dic As New Dictionary
dic.Value("test") = mem

Dim j As New JSONMBS(dic)
MessageBox j.toString // auto encodes it as base64

// let's query value from child()
Dim jm As JSONMBS = j.Child("test")
Dim m1 As MemoryBlock = jm.ValueByteString

// and query via value()
Dim m2 As MemoryBlock = j.Value("test")

Break

Returns nil if type is not kTypeByteString.
(Read only property)

JSONMBS.ValueDouble as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The value of the node.

(Read only property)

Some examples using this property:

JSONMBS.ValueInt64 as Int64

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The Int64 value of the node.

If the node is an Int64, we return it.
Otherwise we try to convert it.
May raise exception if value can't be converted.
(Read only property)

Some examples using this property:

JSONMBS.ValueInteger as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The Integer value of the node.

If the node is an integer, we return it.
Otherwise we try to convert it.
May raise exception if value can't be converted.
(Read only property)

Some examples using this property:

JSONMBS.ValueString as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The value of the node.

(Read only property)

JSONMBS.ValueUInt64 as UInt64

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The UInt64 value of the node.

If the node is an UInt64, we return it.
Otherwise we try to convert it.
May raise exception if value can't be converted.
(Read only property)

Some examples using this property:

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


The biggest plugin in space...