Retrieving the key "name" with Dictionary.Get("name") returns "Joe", and retrieving "score" likewise returns 100. Setting "score" to 50 will change the value for the key.
This is like storing data in instance variables or event variables, but since you can use strings as keys you can store any number of values.
- Compare value
- Compare the value stored for a key.
- Has key
- Check if a key exists in storage.
- Is empty
- True when there are no keys in storage.
- For each key
- Repeat the event once for each key in storage. The CurrentKey and CurrentValue expressions return the current key and its value respectively.
- Compare current value
- Only valid in a For each key event. Compare the value of the current key.
- Add key
- Add a new key to storage, with a given value. If the key already exists, its value is updated.
- Remove all keys from storage, making the object empty.
- Delete key
- Remove a key and its value from storage. If the key does not exist, this has no effect.
- Set key
- Update the value for a key which already exists. If the key does not exist, this has no effect. (Unlike Add key, the key will not be created.)
- (JSON) Invokes a browser download of a file containing the Dictionary's contents in JSON format. This is intended for offline development, e.g. creating level editors.
- (JSON) Load all keys and values from JSON data previously retrieved from the Dictionary object using either the Download action or the AsJSON expression.
- Return the value stored for a key, e.g. Dictionary.Get("score"). If the key does not exist, it returns 0.
- Return the number of keys in storage.
- In a For each key event, these return the key and its value (respectively) for the current key being iterated.
- Return the contents of the Dictionary object in JSON format. This can be later loaded back with the Load action, sent to a server via AJAX, saved to disk, and so on.