local
- Last UpdatedMay 02, 2023
- 2 minute read
A local is a special field that can be created and used inside commands.
-
A local can be accessed only inside the command in which it is created. As a result, you can use use the same local name in different commands. It is renewed at each command execution.
-
You can access a local field by using %idx%, as for the parameters of the command.
-
Therefore, to access the local field value, the correct syntax is @%idx%@.
Platform support
This node is fully supported on XR-Windows, XR-Portable Windows, XR-Portable iOS, XR-Portable Android, and XR-Portable WASM platforms.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
Full support |
Full support |
Full support |
Full support |
|
|
|
|
|
|
Code example
This is a code example for the local statement.
<command name="updateFlow">
<local name="idx" type="sint" value="0">
<while condition="@%idx%@<10">
<!-- ... -->
<setlocal name="idx" value="#@%idx%@+1#" />
</while>
</command>
Fields
These are the fields for local statement.
|
Fields |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
name |
sstring |
Mandatory |
No default value |
The name must be unique inside the command. |
|
type |
sstring |
Optional |
SSTRING |
Type of the local field. |
|
value |
sstring |
Optional |
No default value |
The initialization value. |