break
- Last UpdatedJan 18, 2024
- 2 minute read
The break element causes exit from a block of script inside a command.
It differs from return in that it exits from the command.
Platform support
This element is fully supported on XR-Windows, XR-Portable Windows, XR-Portable iOS, XR-Portable Android, and XR-P 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 break statement.
<command name="updateFlow">
<if condition="@var.value@>3">
<setfield field="node.field" value="0" />
<break condition="@node2.field@==1" />
<!-- the following commands inside the if are not executed if the break condition is true --> .....
</if>
</command>
Fields
These are the fields for break statement.
|
Fields |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
condition |
sstring |
Optional |
No default value |
Adds a condition to the function execution. |