#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2011
    Posts
    2
    Rep Power
    0

    cfloop condition


    Hi,

    In the cfloop condition we can add the conditions as string, such as:

    Code:
    <cfloop condition="a eq 1">
    </cfloop>
    however i have a situation where i need to use:

    Code:
    <cfset condition = "a eq 1" />
    <cfloop condition="#condition#">
    </cfloop>
    if i try this it says it cannot convert the answer to a boolean.

    is there anyway to get this to work?

    thanks
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,263
    Rep Power
    968
    Try condition="#Evaluate( condition )#"
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2011
    Posts
    2
    Rep Power
    0
    perfect, thanks

    Originally Posted by kiteless
    Try condition="#Evaluate( condition )#"

IMN logo majestic logo threadwatch logo seochat tools logo