Lasso Soft Inc. > Home

[Fail_If]

[Fail_If] conditionally halts execution of the current page or [Protect] ... [/Protect] block. Takes three parameters: a conditional expression, an integer error code, and a string error message.

  • Syntax
  • Parameters
[Fail_If: Conditional Expression,
  Error Code, 'Error Message']
Required Parameters
Conditional Expression If true, then the error code and message will be set, otherwise this tag does nothing.
Error Code The error code to return.
Error Message The error message to return.
Examples

To conditionally report a fatal error:

Use the [Fail_If] tag. Lasso will immediately halt processing of the current page or [Protect] ... [/Protect] block and report the error to the user or run any [Handle] ... [/Handle] tags that are present.

The following code will report an unknown error if the [Action_Param] named 'Required' is empty.

[Fail_If: (Action_Param: 'Required') == '', -1, 'Unknown Error]
Tag Link [Fail_If] Category Error
Type Process Data Source Any
Support Preferred Version 5.0
Output Type None Security None
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. > Home

 

 

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