User-defined enumeration does not work

edited May 2012
Hi

I cannot get enum to work in LinqPad

If I try the following code snippet in LinqPad (4.42.04 Premium), it reports an error "} expected".

enum RobotLights { Green, Yellow, Red };
RobotLights robot = RobotLights.Green;
Console.WriteLine(robot);

I am missing something. Can someone please give me some advice?

Daniel

Comments

  • Set the query language to "C# Program" and do this:
    void Main()
    {
        RobotLights robot = RobotLights.Green;
        Console.WriteLine(robot);	
    }
    
    enum RobotLights { Green, Yellow, Red };
    
    Regards

  • That does it. Thanks for the quick answer!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!