Dictionary
- Last UpdatedDec 07, 2023
- 2 minute read
The Dictionary node can read/write DSTRING dictionary content to a file.
Platform support
This node is supported on XR-Windows platform only.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
No support |
No support |
No support |
No support |
|
|
|
|
|
|
Code example
This is a code example for the Dictionary node.
<Dictionary name="dic" file="dicStorage.txt" />
<Var name="aDicVar" type="dstring" value="{key1=value1}{key2=value2}" />
<Command name="cmd_save">
<!-- storing data to file -->
<setfield name="dic.value" value="[@aDicVar.value]" />
<setfield name="dic.save" />
</Command>
<Command name="cmd_load">
<!-- loading data from file -->
<setfield name="dic.load" />
<setfield name="aDicVar.value" value="[@dic.value]" />
</Command>
Fields
These are the fields for Dictionary node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > Dictionary
|
Fields |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
file |
sstring |
Optional |
Not set |
Name of the file used to store dictionary data. A filename must be specified. |
|
load |
sevent |
Optional |
Not set |
When invoked, the value field is populated with data content from the file. |
|
save |
sevent |
Optional |
Not set |
When invoked, the content of value field is stored into file. |
|
value |
dstring |
Optional |
Not set |
Use value to store the content to be written, or to read the loaded content . |