Platforms to show: All Mac Windows Linux Cross-Platform

Back to JSONMBS class.

JSONMBS.NewArrayNode as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new node for an array.
Example
Var n as JSONMBS = JSONMBS.NewArrayNode
MsgBox str(n.Type)+" = "+str(n.kTypeArray)

Some examples using this method:

JSONMBS.NewBooleanNode(value as Boolean) as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a json array object with the given values.

This is a convenience method to quickly create an array.

JSONMBS.NewBoolNode(value as boolean) as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new boolean node.
Example
Var j as JSONMBS = JSONMBS.NewBoolNode(true)
MsgBox j.toString

Some examples using this method:

JSONMBS.NewByteStringNode(Bytes as MemoryBlock) as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new node for a byte string.
Example
Var m As MemoryBlock = "Hello World"
Var j As JSONMBS = JSONMBS.NewByteStringNode(m)

MessageBox j.toString
// "SGVsbG8gV29ybGQ"

Creates a new JSONMBS object with type = kTypeByteString.

See also:

JSONMBS.NewByteStringNode(Bytes as ptr, Length as UInt64) as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new node for a byte string.
Example
Var m As MemoryBlock = "Hello World"
Var p As ptr = m
Var size as integer = m.size
Var j As JSONMBS = JSONMBS.NewByteStringNode(p,size)

MessageBox j.toString
// "SGVsbG8gV29ybGQ"

Creates a new JSONMBS object with type = kTypeByteString.

See also:

JSONMBS.NewByteStringNode(Bytes as String) as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new node for a byte string.
Example
Var j As JSONMBS = JSONMBS.NewByteStringNode("Hello World")

MessageBox j.toString
// "SGVsbG8gV29ybGQ"

Creates a new JSONMBS object with type = kTypeByteString.

See also:

JSONMBS.NewCurrencyNode(value as Currency) as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new currency value node.
Example
Var c As Currency = 152.5678

Var j As JSONMBS = JSONMBS.NewCurrencyNode(c)

MessageBox j.toString

Internally we store number as string with a tag marking it as big decimal, so we output it as number. If you ask for double value, we convert it of course.

JSONMBS.NewDoubleArray(values() as Double) as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a json array object with the given values.
Example
Var n() as Double = array(1.0,2,3)
Var j as JSONMBS = JSONMBS.NewDoubleArray(n)
MsgBox j.toString

This is a convenience method to quickly create an array.

Version 17.0 and newer return empty JSON array node in case of empty string array.
Older versions returned nil.

JSONMBS.NewFalseNode as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new false node.
Example
Var n as JSONMBS = JSONMBS.NewFalseNode
MsgBox str(n.Type)+" = "+str(n.kTypeFalse)

This is a node which represents a boolean false value.

Some examples using this method:

JSONMBS.NewInt32Array(values() as Int32) as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a json array object with the given values.

This is a convenience method to quickly create an array.

JSONMBS.NewInt64Array(values() as Int64) as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a json array object with the given values.

This is a convenience method to quickly create an array.

JSONMBS.NewInt64Node(value as Int64) as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 17.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new node based on Int64 value.
Example
Var x as int64 = 92233720368547758
Var n as JSONMBS = JSONMBS.NewInt64Node(x)

MsgBox "String: "+n.ValueString+EndOfLine+"ToString: "+n.toString+EndOfLine+"Double: "+str(n.ValueDouble,"-0")+EndOfLine+"Int64: "+str(n.ValueInteger,"-0")

Some examples using this method:

JSONMBS.NewIntegerArray(values() as Integer) as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a json array object with the given values.
Example
Var n() as Integer = array(1,2,3)
Var j as JSONMBS = JSONMBS.NewIntegerArray(n)
MsgBox j.toString

This is a convenience method to quickly create an array.

Version 17.0 and newer return empty JSON array node in case of empty string array.
Older versions returned nil.

JSONMBS.NewNullNode as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new null node.
Example
Var n as JSONMBS = JSONMBS.NewNullNode
MsgBox str(n.Type)+" = "+str(n.kTypeNull)

This is a node which represents a nil value.

Some examples using this method:

JSONMBS.NewNumberNode(value as Double) as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new number node.
Example
Var n as JSONMBS = JSONMBS.NewNumberNode(123)
MsgBox str(n.Type)+" = "+str(n.kTypeNumber)

See also:

Some examples using this method:

JSONMBS.NewNumberNode(value as string) as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 17.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new number node with given number as text.
Example
Var n as JSONMBS = JSONMBS.NewNumberNode("92233720368547758")

MsgBox "String: "+n.ValueString+EndOfLine+"ToString: "+n.toString+EndOfLine+"Double: "+str(n.ValueDouble,"-0")+EndOfLine+"Int64: "+str(n.ValueInteger,"-0")

This allows you to control formatting of large integer and floating point values.

See also:

JSONMBS.NewObjectNode as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new object node.
Example
Var n as JSONMBS = JSONMBS.NewObjectNode
MsgBox str(n.Type)+" = "+str(n.kTypeObject)

Some examples using this method:

JSONMBS.NewStringArray(values() as string) as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a json array object with the given values.
Example
Var n() as string = array("Hello", "World")
Var j as JSONMBS = JSONMBS.NewStringArray(n)
MsgBox j.toString

This is a convenience method to quickly create an array.

Version 17.0 and newer return empty JSON array node in case of empty string array.
Older versions returned nil.

JSONMBS.NewStringNode(value as string) as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new string node.
Example
// some string with single/double quote and EndOfLine
Var s as string = "Hello'World"+EndOfLine+"this is "" a test."

// make string node
Var j as JSONMBS = JSONMBS.NewStringNode(s)

// get as JSON
Var d as string = j.toString
// show
MsgBox d

// parse again
j = new JSONMBS(d)

MsgBox j.ValueString

Some examples using this method:

JSONMBS.NewTrueNode as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new true node.
Example
Var n as JSONMBS = JSONMBS.NewTrueNode
MsgBox str(n.Type)+" = "+str(n.kTypeTrue)

This is a node which represents a boolean true value.

Some examples using this method:

JSONMBS.NewUInt32Array(values() as UInt32) as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a json array object with the given values.

This is a convenience method to quickly create an array.

JSONMBS.NewUInt64Array(values() as UInt64) as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a json array object with the given values.

This is a convenience method to quickly create an array.

JSONMBS.NewUInt64Node(value as UInt64) as JSONMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method JavaScript Object Notation MBS Util Plugin 18.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new node based on UInt64 value.
Example
Var x as UInt64 = 92233720368547758
Var n as JSONMBS = JSONMBS.NewUInt64Node(x)

MsgBox "String: "+n.ValueString+EndOfLine+"ToString: "+n.toString+EndOfLine+"Double: "+str(n.ValueDouble,"-0")+EndOfLine+"Int64: "+str(n.ValueInteger,"-0")

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


The biggest plugin in space...