I am used to using PHP and JavaScript but I have now begun working on a project in Coldfusion.
In PHP I am used to a string being "truthy" and empty/null being "falsy".
This doesn't seem to hold true with ColdFusion (specifically v8).
I want to make the following work but cannot figure out how to make CF see the string as truthy:
<cfset x = "path\to\something.cfm">
<cfif x>
x is truthy
<else>
x is falsy
</cfif>
I always get the error: cannot convert the value "path\to\something.cfm" to a boolean
isBoolean()
sort of works but doesn't feel robust enough.- There doesn't seem to be an `isString() -- but this would be problem as above anyway
YesNoFormat()
strangely give me the same error (quite the opposite of what I would have though it should do)