Hello Merlin,
This is perfectly valid for compiler:
and my code is no different, except that one var is in eeprom.
I respect your argument for disliking such enum comparison, but there is a reasonable case when such thing is needed and compiler should let me do it with eeprom vars when it lets me do it with ram vars. For example, I have an engine which triggers various TAlmLogLevel events of different importance like here (enums prefered over constants in this case):
Then I have a user setting stored in eeprom which filters what events shall be stored into flash memory. So, it is perfectly legit to compare event type with user defined filter (of the same type). Therefore I would still like it to be allowed without need for a workaround.
This is perfectly valid for compiler:
Code
if TEnum(One) > TEnum(Zero) then
nop;
endif;
nop;
endif;
I respect your argument for disliking such enum comparison, but there is a reasonable case when such thing is needed and compiler should let me do it with eeprom vars when it lets me do it with ram vars. For example, I have an engine which triggers various TAlmLogLevel events of different importance like here (enums prefered over constants in this case):
Code
TAlmLogLevel = (evIrrelevant, evNormal, evImportant, evCritical);
Then I have a user setting stored in eeprom which filters what events shall be stored into flash memory. So, it is perfectly legit to compare event type with user defined filter (of the same type). Therefore I would still like it to be allowed without need for a workaround.