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

compare always returns false

Enthusiast ,
Jul 11, 2012 Jul 11, 2012

Copy link to clipboard

Copied

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>

Views

719

Translate

Translate

Report

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

...

Votes

Translate

Translate
LEGEND ,
Jul 11, 2012 Jul 11, 2012

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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>

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

thanks BKBK!

bad compiler!

Votes

Translate

Translate

Report

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
Documentation