Skip navigation
Currently Being Moderated

compare always returns false

Jul 11, 2012 7:53 AM

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>

 
Replies
  • Currently Being Moderated
    Jul 11, 2012 11:07 AM   in reply to nikos101

    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?

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 12, 2012 5:29 AM   in reply to nikos101

    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>

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points