ArkScript
A small, fast, functional and scripting language for video games
|
Open a file and read its content as JSON, then return it.
Parameters
filename
: path to JSON fileReturn value UserType
: json value
Author
Example
Takes a String as an argument, representing a JSON object, and return it parsed as a jsonObject.
Parameters
jsonObject
: JSON stored in a stringReturn value UserType
: json value
Author
Example
Retrieve a value from a jsonObject by its key.
Parameters
jsonObject
: JSON objectkey
: a string if the object is a dictionnary, a number if it's an arrayReturn value the stored value
Author
Example
Takes a jsonObject and transforms it into a String.
Parameters
jsonObject
: JSON objectReturn value String
: the string representation of the object
Author
Example
Modify a value in a jsonObject, given a key (String) and a new value.
Parameters
jsonObject
: JSON objectkey
: a stringvalue
: any typeReturn value nil
Author
Example
Take a list of an even number of values, the even ones are the keys (String) and the odd ones the values, and build a jsonObject from it.
Parameters
jsonAsList
: JSON stored in an ArkScript listReturn value UserType
: json value
Author
Example
Take a jsonObject and a filename (String), and write the jsonObject to the file. The file will be created if it doesn't exist, otherwise all the previous content will be wiped before writting to it.
Parameters
jsonObject
: JSON objectfilename
: a stringReturn value nil
Author
Example
Parameters
jsonObject
: JSON objectReturn value Number
: size of the given JSON object
Author
Example