[fpc-pascal] Case statements without constants?
pascaldragon at googlemail.com
Mon Oct 29 11:08:26 CET 2018
Ryan Joseph <ryan at thealchemistguild.com> schrieb am Mo., 29. Okt. 2018,
> I tried today to make a case that used variables instead of constants and
> was surprised to get an error. I’m sure this been true since the 80’s but
> why don’t cases allow variables??? I thought a case statement was just a
> group of if..else blocks in succession.
No it's not. At least for ordinal values it's usually implemented as a jump
table or something optimized like that which would not work with variables
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal