Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

compare always returns false

Enthusiast ,
Jul 11, 2012 Jul 11, 2012

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>

765
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 12, 2012 Jul 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.ignoreBar

...
Translate
LEGEND ,
Jul 11, 2012 Jul 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 12, 2012 Jul 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>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 13, 2012 Jul 13, 2012
LATEST

thanks BKBK!

bad compiler!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources