Enum Action Start 'Stop is a reserved word [Stop] Rewind Forward End Enum Enum Status Flunk = 50 Pass = 70 Excel = 90 End Enum Dim a As Action = Action.Stop If a <> Action.Start Then _ 'Prints "Stop is 1" System.Console.WriteLine(a.ToString & " is " & a) 'Prints 70 System.Console.WriteLine(Status.Pass) 'Prints Pass System.Console.WriteLine(Status.Pass.ToString())
C#
enum Action {Start, Stop, Rewind, Forward}; enum Status {Flunk = 50, Pass = 70, Excel = 90}; Action a = Action.Stop; if (a != Action.Start) //Prints "Stop is 1" System.Console.WriteLine(a + " is " + (int) a); // Prints 70 System.Console.WriteLine((int) Status.Pass); // Prints Pass System.Console.WriteLine(Status.Pass);
Operators
VB.NET
'Comparison = < > <= >= <> 'Arithmetic + - * / Mod (integer division) ^ (raise to a power) 'Assignment = += -= *= /= = ^= <<= >>= &= 'Bitwise And AndAlso or OrElse Not << >> 'Logical And AndAlso or OrElse Not 'String Concatenation &