Lasso Soft Inc. > Home

[Variable_Defined]

[Variable_Defined] returns True if a variable has been defined in the current page or False otherwise. Can be used to check if a variable has been defined even if the current value of the variable is Null or the empty string.

  • Syntax
  • Parameters
[Variable_Defined: 'Variable Name']
Required Parameters
Variable Name The name of the variable.
Examples

To check whether a variable has been defined:

Use the [Variable_Defined] tag with the name of a variable. In the following example, True is returned if the variable Favorite_Color is defined.

[Variable_Defined: 'Favorite_Color']
Result:
True

To set a variable to a default value if it hasn't been defined:

Use the [Variable_Defined] tag to check whether a variable has been defined or not. If it has not then the variable can be set to a default value. In the following example, the variable Favorite_Color is set to Blue if it has not been defined.

[If: (Variable_Defined: 'Favorite_Color') == False]
  [Variable: 'Favorite_Color'='Blue']
[/If]
Tag Link [Variable_Defined] Category Variable
Type Substitution Data Source Any
Support Preferred Version 3.0
Output Type Boolean Security None
Implementation LCAPI Sets Lasso 7.0, Lasso 6.0, Lasso 5.0,LDML3x

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