[PostCondition] evaluates a conditional expression and throws an error if the expression does not return True. The error is equivalent to a syntax error in LDML code.
Most custom tags should deal with errors by outputting appropriate error messages or default values. The [PostCondition] tag can be used as a safety mechanism to ensure that the type or range of output from a tag is strictly enforced.
The tag [Return_Value] can be used to retrieve the current value that is being returned by the tag.
This tag can only be called within [Define_Tag] ... [/Define_Tag] tags. The [PostCondition] tags will be evaluated after all other tags within the [Define_Tag] ... [/Define_Tag] tags.
[PostCondition]
Use the [PostCondition] tag. The following example returns the first parameter to the tag and throws an error if that value is not an array.
[Define_Tag: 'ArrayOnly']
[PostCondition: (Return_Value)->Type == 'array']
[Return: (Params)->(Get: 1)]
[/Define_Tag]
Tag Link | [PostCondition] | Category | Custom Tag |
---|---|---|---|
Type | Process | Data Source | Any |
Support | Preferred | Version | 5.0 |
Output Type | None | Security | Tag |
Implementation | Internal | Sets | Lasso 6.0, Lasso 5.0 |
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft