+ 2

Advanced boolean possible in C#?

In Cobol its possible to make a kind of boolean with multiple options. You create a variable that you can move a character to and than you can have levels below that will become true or false. Char variable boolean is-a boolean is-b boolean is-c ....etc..... If you move "a" to the variable, is-a will become true and the others become false. I have just startet to learn C# and is wondering if you can do something like this in C# also? So far I can only find regular booleans, but if you have a lot of options something like this would be nice.

23rd Dec 2020, 7:46 AM
kooni
5 odpowiedzi
+ 2
That type of boolean is not available in C#.
23rd Dec 2020, 10:54 AM
Sonic
Sonic - avatar
+ 1
I had no idea that COBOL had advanced booleans of that sort.
23rd Dec 2020, 10:55 AM
Sonic
Sonic - avatar
+ 1
Usman Muhammed don't spam
23rd Dec 2020, 10:12 PM
Sonic
Sonic - avatar
0
Is the flag attribute what you are looking for ? https://www.dotnetperls.com/enum-flags
24th Dec 2020, 7:03 PM
sneeze
sneeze - avatar