Assignment by parameter value
- Last UpdatedDec 06, 2023
- 1 minute read
Assignment by parameter value is the assignment mode that is mainly used inside condition and value parameters. These are used by connection nodes such as the route node, and in some command nodes such as the setfield node.
These parameters are all SSTRING type, so the only way to discriminate between a parameter or variable name and its value is to use a marker.
Syntaxes
There are two syntaxes for assignment by value:
-
Direct value
-
Nested values
Additionally, assignment by parameter supports a set of prefixes that can be used to access parameters located in special frameworks.
Direct syntax
To refer directly to the value of a parameter, the syntax is @objectName.fieldName@.
This kind of syntax parses faster than nested syntax. It is preferred where there is no need for a nested value assignment.
Code example
This is a code example for direct syntax method.
condition="@av0.cameraMode@==fps"value="@var0.value@"
Nested values syntax
To use nested field value assignments, use the syntax, [@objectName.fieldName].
With this syntax, you can define an assignment where the name of the node or the parameters depends on the value of another parameter.
This method gives flexibility to the scripting language and allow you to produce more compact scripts.
Code example
This is a code example for nested value syntax.
condition="[@av[@selectedCamera].cameraMode]==fps"text="[@dpi_[@vestizione.dpi.line0.id]]"