@bool Function |
![]() ![]() ![]() |
@bool() function is used to convert the result of the given expression to a Boolean. We already know that if the given parameter is a symbol we can use data type specifier 'b:' in front of the symbol name for the same purpose, but that wouldn't work if the parameter is an expression. Syntax: @bool(expression [, default-value])
Example: @doif( bool(i:ACTIVE,false) ) .. @doend()
In the example if the i:ACTIVE symbol contains a Boolean value then it, otherwise false will be returned from the bool() function.
|