$objectCreate
Creates a json object from the input
Use $getObjectProperty
or $objectGet
to get a key value.
$objectCreate[JSON string]
Usage: Saving Object inside Vars
The example above shows how to save the object inside a variable and retrieve it later.
- with an object you can save many properties inside a variable.
$initvar[user;Data;{"Name":"none","Level":0,"isExpert":false,"userId":0}]
$objectCreate[$getuservar[Data]]
$objectSet[Name;Wiki]
$objectSet[Level;20]
$objectSet[isExpert;true]
$objectSet[userId;327996784012034050]
/*You can change the value by using $objectSet. You can save it inside a var by using $getObject*/
$setUserVar[Data;$getObject]
/* $getUserVar[Data] will now return: {"Name":"Wiki","Level":20,"isExpert":true,"userId":327996784012034050}*/
Get values from an array
{
"string":"Needs quotation marks",
"numbers":1234,
"boolean":true/false,
"array":["Value","Value","Value"],
"group":{
"String":"Value",
"numbers":Value,
"boolean":Value
},
"arrayGroup":[{
"String":"value"},{"String":"value"},{"String":"value"}]
}
- use
$objectGet[groupname;key]
to get the value or $objectGet[groupname;key;index] to get the value of an array