Lasso Soft Inc. > Home

[ local_defined ]

Method

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

Note that this is entered for compatibility and is functionally equivalent to local(local_name)->isNotA(::null).

Please refer to the documentation for "isA" and "isNotA" for specific documentation.

  • Syntax
local_defined('var_name')
Examples
  • Beginner

To check if a variable has been defined in the current included file:

Use [local_defined] to return true or false.

Code

local(rhinoCount = 27)
local_defined('rhinoCount') ? 'We have counted some rhinos!'

Result

We have counted some rhinos!

Recent Comments

No Comments found

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