LassoScript Utility
Basics Browse Detail

[Null->Invoke]

Tag Link [Null->Invoke] Category Tags
Type Member Source Available No
Support Preferred Version 7.0
Change Unchanged Data Source Any
Output Type Any Security None
Implementation Internal Sets Lasso 8.5, Lasso 8.0, Lasso 7.0

Description

[Null->Invoke] is a member tag which can be used with any data type. The results of calling [Null->Invoke] differ depending on what type it is called on.

Tag - [Tag->Invoke] works just like calling the tag directly. The parameters to [Tag->Invoke] are passed to the tag. For example: [\Field->(Invoke: 'Field_Name')] is equivalent to [Field: 'Field_Name'] or [\Field->(Run: -Params=(Array: 'Field_Name'))].

Pair - If a pair has a tag as its first element and an array as its second element then calling [Pair->Invoke] on it will execute the tag and pass the second element to the tag as its parameter array. Any other parameters passed to [Tag->Invoke] are passed after the first parameters. For example [(Pair: \Field = (Array: 'First_Name'))->Invoke] will yield the same result as [Field: 'First_Name']. This type of pair is called a "closure" and enables a method of implementing callback tags.

Others - Most other types simply return their value when [Null->Invoke] is called on them. This is true for most built-in Lasso types such as integers, decimal values, strings, etc.

Custom Types - Custom types can override the [Type->Invoke] tag in order to provide custom behavior.

Syntax

[\Tag Name->(Invoke: Parameters)]

[{Compound Expression}->(Invoke: Parameters)]

[(Pair: \Tag Name = Parameters Array->(Invoke: Additional Parameters)]

[(Pair: Compound Expression = Parameters Array->(Invoke: Additional Parameters)]

[Any Type->Invoke]

Parameters

Optional Parameters
Parameters All parameters are passed to the base data type.

Examples

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