User Tools

Site Tools


codex

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
codex [2024/10/20 21:36] justincodex [2025/03/11 17:18] (current) justin
Line 30: Line 30:
 </code> </code>
 The script above creates an empty codex variable, then inserts a new key/value pair with a key of "unique_key" and a [[string]] value of "Some Value". The script above creates an empty codex variable, then inserts a new key/value pair with a key of "unique_key" and a [[string]] value of "Some Value".
 +
 +====Iterating All Keys:====
 +<code bauxite>
 +$my_codex = codex["name": "Stumpy", "genus": "Sciurus"];
 +for $key in $my_codex do
 +   display_message("Key: " + $key + ", Value: " + str($my_codex[$key]));
 +end;
 +</code>
 +The script above displays each key of the codex along with its corresponding value. The "str" function is used to convert whatever the stored value is to a [[string]] before displaying it.
  
 ~~NOTOC~~ ~~NOTOC~~
codex.1729485379.txt.gz · Last modified: 2024/10/20 21:36 by justin