Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9134583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:41:17+00:00 2026-06-17T08:41:17+00:00

I am used to using PHP and JavaScript but I have now begun working

  • 0

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)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:41:18+00:00Added an answer on June 17, 2026 at 8:41 am

    ColdFusion has some similar “truthiness” functionality to it.

    The following will evaluate to true

    • The strings “true” or “yes” (case insensitive)
    • Any non-zero number
    • The value true

    The following will evaluate to false

    • The strings “false” or “no” (case insensitive)
    • Zero
    • The value false

    In CF we generally use the len() function to determine if a string has anything in it. Since a non-zero number evaluates to “true” this works.

    Your pseudo-code would be, then:

    <cfset x = "path\to\something.cfm">
    <cfif len(x)>
        x is truthy
    <else>
        x is falsy
    </cfif>
    

    Since ColdFusion converts nulls to empty strings, using trim() in conjunction would be a good idea, like so: <cfif len(trim(x))>.

    There is no isString() function, but there is isValid(): isValid("string",x)

    YesNoFormat() simply turns a boolean value into a nicely formatted “Yes” or “No”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using jQuery lately, but never used JSON with it. Now, I
I used to have PHP websites and using url rewriting on picture to have
We're used to using websites like youtube in full screen, but now Facebook offers
Right now I'm working on PHP. I am using the Doctrine ORM and the
I totally want to avoid using inline javascript! But i have a table which
I am trying to build a data management system online using mysql/php/javascript/etc. I have
I'm used to using the command mysql_insert_id() in PHP to return the id of
I used Firebug to inspect the HTML my php(using wordpress) files created. According to
I want to use this function: http://www.frankmacdonald.co.uk/php/post-to-wordpress-with-php.html Its used to post to Wordpress using
I have used the using statement in both C# and VB. I agree with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.