M
MuZZy
Hello,
I want to define an enum type, which in delphi would look like:
--------------------------------------------------------
Type
TOperator = ( opPlus, opMinus, opDivide, opMul, opUnaryMinus );
Var
operator : TOperator;
...
operator := opPlus
--------------------------------------------------------
How do i do that in C#?
If i define:
enum TOperator { opPlus, opMinus, opDivide, opMul, opUnaryMinus };
that's a variable definition, not a class def, right? And i couldn't do:
TOperator op = opPlus; //???
Do i do it this way: Type op = Typeof(TOperator); //?
Thank you,
Andrey
I want to define an enum type, which in delphi would look like:
--------------------------------------------------------
Type
TOperator = ( opPlus, opMinus, opDivide, opMul, opUnaryMinus );
Var
operator : TOperator;
...
operator := opPlus
--------------------------------------------------------
How do i do that in C#?
If i define:
enum TOperator { opPlus, opMinus, opDivide, opMul, opUnaryMinus };
that's a variable definition, not a class def, right? And i couldn't do:
TOperator op = opPlus; //???
Do i do it this way: Type op = Typeof(TOperator); //?
Thank you,
Andrey