{ } Braces

Delimiter

Delimiter

Preferred

6.0

Braces { } allow a compound expression to be defined. A compound expression can be thought of as a LassoScript which can be stored in a variable or as a tag that does not have a name. The syntax within a compound expression is the same as that for LassoScripts.

Compound expressions are executed using the member tags of the tag data type.

{ ... }->(Eval) evaluates the contents of the braces within the surrounding context. All variables defined or referenced in the compound expression are page variables. The compound expression can return a value using the [Return] tag.

{ ... }->(Run) executes the contents of the braces as if they were a tag. The -Params parameter can be added to the [Tag->Run] tag to specify parameters for the compound expression (which are then accessed through the [Params] array). Local variables can be defined within the compound expression. The compound expression can return a value using the [Return] tag.

{ ... }->(AsAsync) evaluates the contents of the braces asynchronously in a new thread. No page variables can be referenced within the compound expression. The compound expression cannot return a result. The [Sleep] tag can be used to pause the compound expression before execution.

[{ Return: 'value'; }->(Eval)]

[{ Return: 'value'; }->(Run: -Params=(Array: ...))]

[{ Sleep: 10; ... }->(AsAsync)]

[Variable: 'myExpression' = { ... }]
[$myExpression->(Eval)]

{ } Braces