ue_json

work with json format in beas script

 

you can decalre a json object with

declare=j=ue_json

or

instance json j

 

both create the object ue_json

at end you must destroy the object with

destroy=j

 

Function

Description

parse

<string>

<getfieldnames()>

<stringify>

set

setnumber

setboolean

setdate

 

 

Example

Create a json object and create 2 properties

 

instance json j
j.set=test1=Algo
j.set=test2=Benzon
messagebox=<j.test1> 
// Display: Algo
messagebox=<j.stringify>
// Display complete object:  {"test1": "Algo","test2": "Benzon"}

 

Example

Parse a json string and return values from properties

instance json j
j.parse={"test1":"Algo","test2":"Benzon"}
messagebox=<j.test1>
// Display "Algo"

 

 

Example

Json with SubObject

instance json j
j.parse={"Color": [ {"Red":1}  ,  {"Blue":1}  ] }
messagebox=<j.Color.1.Red>
// Display: 1