Announcement

Collapse
No announcement yet.

Possible Incorrect Evaulation of 'Equals' (==)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Possible Incorrect Evaulation of 'Equals' (==)

    I have been debugging an indicator I recently wrote.

    I kept having an unexplained error. It took me nearly a day to conclude that the "if ( aaa == bbb ) {" statement does not always work correctly.

    I have enclosed the evidence and localised code for perusal. This is contained in the attached Word document.

    If it is a mistake on my part, please enlighten. If it is a known bug, sorry I have not been able to find a reference and would be grateful if someone could let me know how to find such a posting for the future.

    Otherwise, I'd be most grateful if a reliable and easy work-around could be suggested whilst the bug is being fixed.

    Regards. G.
    Attached Files

  • #2
    Hello G,

    I'm not convinced from the info in the doc you posted that there is a problem with the == operator. Between the lines where the "_Save" values are set and the if() statement that is printing your error info, you have some logic that is potentially changing the values of bOkToEnterShort and bOkToEnterLong. This would cause one of the two conditions in your if() statement to evaluate to true and print the error info. I think you may be dealing with a code logic error rather than a bug in the language.

    Which specific line of code with the == operator do you feel is failing? What you should do is add a debugPrintln() statement inside the conditional if() statement in question and print the values of the variables (or array elements) to the formula output window. Also add the same debugPrintln statement to the else block. By adding the bar index to the debugPrintln() string you will easily be able to see what the values were at each bar.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment

    Working...
    X