Page 2 of 2

Re: case statements can have the same values?

Posted: Fri Mar 15, 2024 11:21 am
by Axolotl
Thanks Fred and to all discussants.

It's okay with me that the compiler can't recognize everything.
However, in the case of a select case statement in connection with constants, a warning would not be bad.

Re: case statements can have the same values?

Posted: Fri Mar 15, 2024 2:16 pm
by PBJim
Caronte3D wrote: Fri Mar 15, 2024 9:21 am Workaround:

Code: Select all

Select dummy
  Case Bool((acctype = "C") And (amount > cutoff))
    Debug "Case 1"
        .
        .
Interesting, thanks very much Caronte3D. I'd seen Bool() before but didn't see its potential at the time. It seems odd to me though, because Bool() appears in the documentation as a compiler function, which perhaps had lead me to believe it was a compile-time feature, but quite clearly that isn't the case, as it's indeed working well at runtime, the way you've done it. :D

Re: case statements can have the same values?

Posted: Fri Mar 15, 2024 2:23 pm
by Caronte3D
Yeah! Put a Bool in your life and be happy! :lol: