InsertJSONStructure()

Syntax

InsertJSONStructure(JSONValue, *Buffer, Structure)
Description
Insert the contents of the specified structure memory into the given JSON value. The JSON value will be changed to type #PB_JSON_Object and contain one member for each member in the structure.

Parameters

JSONValue The JSON value. The previous content of the value will be changed to the contant of the structure.
*Buffer The address of the structure to insert into the JSON value.
Structure The type of the structure to insert.

Return value

None.

Example

  Structure Person
    FirstName$
    LastName$
    Age.l
    List Books.s()
  EndStructure
  
  Define P.Person
  P\FirstName$ = "John"
  P\LastName$  = "Smith"
  P\Age        = 42
  AddElement(P\Books()): P\Books() = "Investing For Dummies"
  AddElement(P\Books()): P\Books() = "English Grammar For Dummies"
  AddElement(P\Books()): P\Books() = "A Little Bit of Everything For Dummies"
  
  If CreateJSON(0)
    InsertJSONStructure(JSONValue(0), @P, Person)
    Debug ComposeJSON(0, #PB_JSON_PrettyPrint)
  EndIf

See Also

InsertJSONArray(), InsertJSONList(), InsertJSONMap(), ExtractJSONArray(), ExtractJSONList(), ExtractJSONMap(), ExtractJSONStructure(),

Supported OS

All

<- InsertJSONMap() - Json Index - IsJSON() ->