Complete lack of logic over converting ENUM variables - page 2

 
TheHonestPrussian #:

Everyone, take note of this answer.

This is how you answer a question: not by stupid irrelevant questions. not by passive aggressive bullshit. If everyone actually applied this persons thinking here - this forum would be such a nightmare. 

Thank you @ Vladislav Boyko, much appreciated and all the best to you. 

No you should take note.  You started with a rant and calling the software names….  

I also gave you the answer use the enum you setup up and not values. Casting is a fudge when you have an enum defined and leads to mistakes as you have now discovered 
 
TheHonestPrussian:

The stupidity here is unbelievable at times, I have the following:

Then, on initialization. I have the following: 

Upon compiling, I get the following:

Why does this complete imbecilic piece of software have no problem converting "maxRsquared" but has a hissy fit about converting "minRsqaured", despite them both being of ENUM type?

Absolutely, unbelievable. Logic beggars belief. 

I would like to mention, a rude behavior is not welcomed here to receive help.

I will not spoon-feed you a solution, there have been given you very proper answers, and you should stop making your life difficult.

I suggest following approach: break down the problem into required pieces, and use the proper tools to solve your task.

1. Seems input the user can do.
2. Seems compare the values.

Ok, you cannot compare two different enums with each other. So, one solution seems to be to convert the enums to something you can compare as required.

Convert your enums into an "int" value and compare these.

What is the problem? This solution was already given to you a few posts up.
 
Please be aware:
- enum "names" are acrually for human, so that they are more readable than blank meaningless constant numbers.
- enum "names" are (automatically) assigned with constant number starting from zero (0) and increasing.
You have the option to assign specific constant number to eaxh names.
- You can use enums as integer value when you explicitly convert them to integer.

Good luck.

Note:
You can name enum entries as you like, its real value always start from zero (0) unless you assign it to custom value.