Skip to main content
nikos101
Inspiring
July 11, 2012
Answered

compare always returns false

  • July 11, 2012
  • 2 replies
  • 802 views

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 topic has been closed for replies.
    Correct answer BKBK

    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>

    2 replies

    BKBK
    Community Expert
    BKBKCommunity ExpertCorrect answer
    Community Expert
    July 12, 2012

    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>

    nikos101
    nikos101Author
    Inspiring
    July 13, 2012

    thanks BKBK!

    bad compiler!

    Inspiring
    July 11, 2012

    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?