Json
For working with JSON strings and objects
Lib.Sys.Json.parse(text) |
Parses given JSON-encoded text and returns the resulting object. |
text - Json text |
Lib.Sys.Json.stringify(value, replacer, space) |
Encodes the given value and returns the resulting JSON string. |
value - Json object replacer - function for encoding space - string, usually set of spacebars for pretty-printing |
Examples:
json = Lib.Sys.Json.parse([[{
"glossary": {
"title": "example glossary",
"GlossDiv": {
"title": "S",
"GlossList": {
"GlossEntry": {
"ID": "SGML",
"SortAs": "SGML",
"GlossTerm": "Standard Generalized Markup Language",
"Acronym": "SGML",
"Abbrev": "ISO 8879:1986",
"GlossDef": {
"para": "A meta-markup language, used to create markup languages such as DocBook.",
"GlossSeeAlso": ["GML", "XML"]
},
"GlossSee": "markup"
}
}
}
}
}]])
print(json.glossary.title)
print(json.glossary.GlossDiv.GlossList.GlossEntry.GlossDef.GlossSeeAlso[1])
print(Lib.Sys.Json.stringify( json, nil, ' ' ))
Created with the Personal Edition of HelpNDoc: Free help authoring environment