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 6693715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:01:01+00:00 2026-05-26T06:01:01+00:00

I have been having the hardest time trying to resolve the weirdest error when

  • 0

I have been having the hardest time trying to resolve the weirdest error when any kind of condition is used within any kind of loop.

The error I keep getting is: “Complex object types cannot be converted to simple values.” on the line that contains <cfloop condition="true">. What’s even funnier is that a <cfbreak> doesn’t break out of the loop. I have used the debugger within Eclipse to confirm that this code is actually executed.

The odd thing is sometimes the code loops forever even though I know the <cfbreak> gets executed and sometimes it errors out on the first iteration.

I’ve confirmed that this issue occurs on two other computers as well.

Before everyone freaks out on my use of the always true condition, I used to have a valid condition: <cfloop condition="not done"> where done was a boolean. This caused the same error.

I’m working on older code written by someone else, so rewriting isn’t an option at this time.

I have just patched ColdFusion 8.0.1 to the latest updater 4 to see if that would resolve the issue and it hasn’t.

This is what the code essentially looks like:

<cfloop condition="true">
    <cfif condition is true>
        <cfbreak>
    </cfif>
</cfloop>

Here is the code that does get executed:

<cfset done = false />
<cfloop condition="true">
    <cfscript>
        try
        {
            lineitem.quantity = quantityRemaining;

            quantityRemaining = 0;

            arrayAppend( currentTub, lineitem );

            currentCartItemCount = currentCartItemCount + lineitem.quantity;
            currentTubItemCount = currentTubItemCount + lineitem.quantity;

        }
        catch(Any e){}


        availableSpaceInCart = this.itemsPerCart - currentCartItemCount;
        availableSpaceInTub = this.itemsPerTub - currentTubItemCount;
    </cfscript>

    <cfif quantityRemaining LTE 0>
        <cfset done = true />
        <cfbreak />
    </cfif>
</cfloop>

UPDATE:

Well we figured out what the issue was. There was two <CFOUTPUT> tags wrapped around this loop, the outer <CFOUTPUT query='query_name' groupby='column_name'> tag was using a QueryNew() generated query which for some reason ColdFusion didn’t like. So we resolved that issue and it resolved our weird issue.

  • 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-05-26T06:01:02+00:00Added an answer on May 26, 2026 at 6:01 am

    You are passing ambiguous values to a conditional loop.

    When you write:

    <cfloop condition="x">
    

    You are telling ColdFusion: continue to loop so long as ‘x’ evaluates to true. This could be a statement like (myvar gte 10), which would evaluate to true if myvar is greater than or equal to 10. If some mechanism inside the loop decrements myvar, eventually, a pass through the loop will cause it to stop, because myvar will no longer be greater than or equal to 10 (it has dropped below 10).

    Now, let’s look at your condition:

    <cfloop condition="true">
    

    Is CF considering it as:

    <cfif 'true'>
    

    Or

    <cfif TRUE>
    

    One is definitely wrong, and will throw an error, if you write into a ColdFusion statement. You will probably find that you cannot evaluate a “string” into a boolean TRUE or FALSE evaluation. I’m almost certain the parsing of a string value is confusing ColdFusion with the actual boolean TRUE or FALSE value. It is perhaps this lexical conversion of ‘true’ to TRUE that is causing your object-related errors. What you want, more than likely is:

    since the value of done is set to FALSE to start, which, when coupled with a logical NOT, evaluates to true.

    Then, later down your statement:

       <cfif quantityRemaining LTE 0>
            <cfset done = true />
       </cfif>
    

    There is no need for a <cfbreak> statement, which forcibly breaks you out of a loop. If you are conditionally looping, the evaluation of that variable will affect the iteration of the loop (read: it will stop it).

    Furthermore, you may very well want to change your condition to:

    <cfloop condition="quantity LTE 0">
    

    and will not require the done variable at all.

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

Sidebar

Related Questions

I have been having some problems trying to get my PHP running. When I
I have been having problems with this for some time now, and have come
I have been having trouble searching through a MySQL table, trying to find entries
I have been having trouble with Hibernate and Mysql timeout error for a week.
I have been having this problem for some time now, I dont exactly know
I have been having a hell of a time sorting out PayPal's documentation ,
i have been having this issue for some time now, and have not gotten
I have been having this problem for quite some time. I create a dataset
I have been having a heck of a time getting Udp sockets working correctly
i have been having this trouble when trying to obtain json data. lets say

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.