Search code examples
crystal-reports

List comparison behavior in crystal reports language


I'm responsible for this crystal report that was previously maintained by outside contractors. Because of this, there are a lot of ambiguous lines in crystal formulas because the semantics make no sense. Enough duct tape was put on it that it works. This line, however, continues to confuse me.

if {ODWR_CM_TRANSACTION.CM_PAYMENT_TYPE_CODE} = ["10", "17"]

I believe that the original developer meant this:

if {ODWR_CM_TRANSACTION.CM_PAYMENT_TYPE_CODE} in ["10", "17"]

What confuses me is that it appears to work? My question is this: is crystal interpreting the = operator as in because of the type mismatch, or is spaghetti code somewhere else compensating for this broken code?


Solution

  • Yes, Crystal handles these two versions as equivalent.