2 Replies Latest reply on Dec 22, 2012 4:28 AM by BKBK

    CFelseif question

    userCold9 Level 1

      Hi,

       

      I have code the works in one environment, but the exact same code does not work in another environment.

       

      Both environments reside on the same server with Cold Fusion 9 Enterprise.

       

      The code contains:

      <CFIF   >

       

           <CFelseif   >

       

           <cfelse    >

      </CFIF >

       

      There are 5 nested CFelseif's within the <CFIF  > </CFIF>. Also, there are 3 sets <CFIF  >  </CFIF> of code 5 nested CFelseifs.

       

      When I seperated the code into seperate <CFIF  >    </CFIF>, the code works in the environment where the CFelseif does not work.

       

      Is there some limit of CFelseif? Or is there a patch that needs to be installed?

       

       

       

      Mike

        • 1. Re: CFelseif question
          Adam Cameron. Level 5

          Mike: respectfully, please read my blog article regarding "how to ask for help" (http://adamcameroncoldfusion.blogspot.co.uk/2012/12/need-help-know-how-to-ask-for-it.html), and consider revising your question.

           

          In short, no there is no limitation in CFML in this area. The problem will be with your code. We cannot offer any assistance beyond that whilst your question is so vague.

           

          Cheers.

           

          --

          Adam

          • 2. Re: CFelseif question
            BKBK Adobe Community Professional & MVP

            userCold9 wrote:

             

            There are 5 nested CFelseif's within the <CFIF  > </CFIF>. Also, there are 3 sets <CFIF  >  </CFIF> of code 5 nested CFelseifs.

             

            When I seperated the code into seperate <CFIF  >    </CFIF>, the code works in the environment where the CFelseif does not work.

            That is one you cannot blame on ColdFusion. Nested if-statements, like nested goto-statements, are notorious for increasing the logical complexity of your code.

             

            You should show us the code. If you can't, then at least show us the structure of the <cfif><cfelseif><cfelse> nesting. Also say what you expected and where you think it goes wrong.