|
htmlbool
| Format:
htmlbool ( value ) |
Purpose:
Checks whether value, if interpreted as a HTML Boolean argument, is true.
Return Values:
A HTML Boolean is false if:
- it is the Boolean false
- it is the null value
If one of these conditions is fulfilled, the htmlbool() returns false, otherwise true.
Example:
| heitml input: | resulting output:
|
| <? htmlbool(true)>
| true
| | <? htmlbool(false)>
| false
| | <? htmlbool("true")>
| true
| | <? htmlbool("false")>
| true
| | <? htmlbool("Gwendolyn")>
| true
| | <? htmlbool(" ")>
| false
| | <? htmlbool("")>
| false
| | <? htmlbool(null)>
| false
| | <? htmlbool(emptytuple)>
| false
| | <? htmlbool(5)>
| true
| | <? htmlbool(3.1415)>
| true
|
Tip: The htmlbool() function should prove useful when you
need to redefine a HTML tag with optional arguments of Boolean type.
Example:
heitml input:
<def gnarl verbose=null;
if htmlbool(verbose)>
We're gnarling now
</if;
? "gnarl!";
/def>
<gnarl><br>
<gnarl verbose>
| resulting output:
gnarl!
We're gnarling now
gnarl!
|
See Also:
isdecl(), isempty().
This page was dynamically generated by
heitml
© 1996-2009 H.E.I. All Rights Reserved
|