Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
Type = SRP_Json(Handle, "TYPEType")

Returns

The JSON entity's type.

Parameters

ParameterDescription
HandleHandle to a JSON Entity. Required.

Remarks

The TYPE Type service returns a JSON entity's type. The type will be one of five values: "Array", "Boolean", "Number", "Object", or "String".

Example

Code Block
// Create a bunch of entities
SRP_JSONJson(ObjectHandle, "NEWNew", "OBJECTObject")
SRP_JSONJson(IntegerHandle, "NEWNew", "NUMBERNumber", "1234567890")
SRP_JSONJson(DecimalHandle, "NEWNew", "NUMBERNumber", "123456789.987654321")
SRP_JSONJson(StringHandle, "NEWNew", "STRINGString", "Hello, World!")
SRP_JSONJson(BooleanHandle, "NEWNew", "BOOLEANBoolean", 1)
SRP_JSONJson(ArrayHandle, "NEWNew", "ARRAYArray")

// Look at their types
Type = SRP_JSONJson(ObjectHandle, "TYPEType")   ; // "Object"
Type = SRP_JSONJson(IntegerHandle, "TYPEType")  ; // "Number"
Type = SRP_JSONJson(DecimalHandle, "TYPEType")  ; // "Number"
Type = SRP_JSONJson(StringHandle, "TYPEType")   ; // "String"
Type = SRP_JSONJson(BooleanHandle, "TYPEType")  ; // "Boolean"
Type = SRP_JSONJson(ArrayHandle, "TYPEType")    ; // "Array"

// Remember to clean up
SRP_JSONJson(ArrayHandle, "RELEASERelease")
SRP_JSONJson(BooleanHandle, "RELEASERelease")
SRP_JSONJson(StringHandle, "RELEASERelease")
SRP_JSONJson(DecimalHandle, "RELEASERelease")
SRP_JSONJson(IntegerHandle, "RELEASERelease")
SRP_JSONJson(ObjectHandle, "RELEASERelease")