LassoScript Utility
Basics Browse Detail

{ } Braces

Tag Link { } Braces Category Delimiter
Type Delimiter Source Available No
Support Preferred Version 6.0
Change Unchanged Data Source Any
Output Type Any Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0

Description

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.

Syntax

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

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

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

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

Parameters

No Parameters Required.

Examples

See the Lasso 8 Language Guide for examples of how to use this tag.