Lasso Soft Inc. > Home

[PostCondition]

[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.

  • Syntax
  • Parameters
[PostCondition]
Required Parameters
Conditional Expression The conditional expression must be true or an error will be generated.
Examples

To define a tag that only returns values of a certain data type:

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 LCAPI Sets Lasso 7.0, 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. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft