Requires a type name as a parameter. Returns True if the base object is of that type or has that type as a parent type. Note that Null is the base type for all objects in Lasso. Using [Null->isa('Null')] will always return true.
null->isA(::typetocheck)
null->isA('typetocheck')
Use the [Null->IsA] tag. The following example checks a local to see whether it is a string before performing a string operation on it.
Code
local(mystring='red,green,blue')
if(#mystring->isA('string')) => {
local(myarray = #mystring->split(','))
else
local(myarray = array)
}
#myarray
Result
array(red, green, blue)
Code
! var(myvar)->isA(::array)
? $myvar = array('a','b','c')
$myvar
Result
array(a, b, c)
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
Recent Comments