isBoolean
Description
Determines whether a value can be converted to Boolean
Categories
Related
Syntax
IsBoolean(value)
Attributes
| Attribute | Description | Required | Default |
|---|---|---|---|
| value | Number or string |
Returns
True,
if the parameter can be converted to Boolean; False, otherwise.
Example
<h3>IsBoolean Example</h3>
<cfif IsDefined("FORM.theTestValue")>
<cfif IsBoolean(FORM.theTestValue)>
<h3>The expression <cfoutput>#DE(FORM.theTestValue)#</cfoutput> is
Boolean</h3>
<cfelse>
<h3>The expression <cfoutput>#DE(FORM.theTestValue)#</cfoutput> is not Boolean</h3>
</cfif>
</cfif>
<form action = "isBoolean.cfm">
Enter an expression, and discover whether it can be evaluated to a
Boolean value.
<input type = "Text" name = "TheTestValue" value = "1">
<input type = "Submit" value = "Is it Boolean?" name = "">
</form>