Objects

Edit

Introduction #

To do.


Edit

Create Object #

Creates a new empty object or overrides an existing one.

Box Name Type Description
Object Name String New object name


Edit

Set Object Variable #

Create a new object key or change a value inside an existing key.
You cannot set other objects or arrays as object keys.

Box Name Type Description
Object String Name of the object you want to access
Key String The name of the new or existing key
Value Any Value to associate with the key


Edit

Get Object Variable #

Retrievs a value associated with the specified object key.

Box Name Type Description
Object String Name of the object you want to access
Key String The name of the key containing the value
Save Variable String Variable name to save the object key value


Edit

Object Get First Key #

Retrieves the first object key. You can use this command together with Object Get Next Key to iterate over all object keys.
Unlike in some other languages, object keys are not sorted and their order is not guaranteed in LioranBoard.

Box Name Type Description
Object String Name of the object you want to access
Save Variable String Variable name to save the retrieved key into


Edit

Object Get Next Key #

Retrieves the next object key. You can use this command together with Object Get First Key to iterate over all object keys.
Unlike in some other languages, object keys are not sorted and their order is not guaranteed in LioranBoard.

Box Name Type Description
Object String Name of the object you want to access
Key String Object key to continue to iterate from
Save Variable String Variable name to save the retrieved key into


Edit

Object Get Size #

Gets a size of an object, i.e. how many keys the object contains.

Box Name Type Description
Object String Name of the object you want to check
Save Variable String Variable name to save the object size


Edit

Stringify Object #

Returns a JSON string of the whole object.
You can use this command together with File: Save String command to save the whole object into a file. Once loading it back from the file, you can use Parse Array/Object command to turn the JSON string back into the original object.

Box Name Type Description
Variable String Variable to save the JSON string of the object into
Object Name String Name of the object to stringify


Edit

Parse Array/Object #

Turns a JSON string into an array/object. Must be properly formatted (LioranBoard will give you a warning if it finds any formatting errors).
This way you can easily create a prepopulated object/array, as it supports nesting.
Read more about JSON syntax at w3schools.com.

Box Name Type Description
Array/Object Name String Name of the variable to save the parsed array/object into
String Array/JSON JSON String JSON string to parse
JSON string before conversion Result saved in the variable
{
   "Lioran":"blue",
   "Melonax":"orange",
   "Sebas":"red"
}
    
Parsed JSON string
{
   "Names":{
      "Lioran":"blue",
      "Melonax":"orange",
      "Sebas":"red"
   },
   "randomNumbers":[
      1,
      8,
      9,
      15
   ],
   "singleValue":"Hello World"
}