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.
case statements can have the same values?
Re: case statements can have the same values?
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
Re: case statements can have the same values?
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.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" . .

Re: case statements can have the same values?
Yeah! Put a Bool in your life and be happy! 
