3 Replies Latest reply: Jul 13, 2012 1:50 AM by nikos101 RSS

    compare always returns false

    nikos101 Community Member

      can anyone see why this always returns false     regardless of ObservedType??

       

       

      <cfset isNullfwdExtraWindow = false>

          <cfif arguments.trade.ObservedType eq 'C'>

              isNullfwdExtraWindow = true>

          </cfif>

          <cfif arguments.trade.ignoreBarrierStyleAndObserved>

              isNullfwdExtraWindow = true>

          </cfif>

        • 1. Re: compare always returns false
          Dan Bracuk Community Member

          When in doubt, look at your data.  My technique is:

           

          if (something)

          output yes

          else

          output no and whatever I was checking.

           

          By the way, what is this checking - <cfif arguments.trade.ignoreBarrierStyleAndObserved>  ?  Is that a boolean variable?

          • 2. Re: compare always returns false
            BKBK MVP

            nikos101 wrote:

             

            can anyone see why this always returns false     regardless of ObservedType??

             

            <cfset isNullfwdExtraWindow = false>

                <cfif arguments.trade.ObservedType eq 'C'>

                    isNullfwdExtraWindow = true>

                </cfif>

                <cfif arguments.trade.ignoreBarrierStyleAndObserved>

                    isNullfwdExtraWindow = true>

                </cfif>

            This code misses the cfset tag. You could try something like

             

            <cfset isNullfwdExtraWindow = false>

            <cfif trim(arguments.trade.ObservedType) eq 'c' OR arguments.trade.ignoreBarrierStyleAndObserved>

                 <cfset isNullfwdExtraWindow = true>

            </cfif>

            • 3. Re: compare always returns false
              nikos101 Community Member

              thanks BKBK!

               

               

              bad compiler!