Sign in to follow this  

enums

This topic is 1191 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm sure this is me being silly but I can't make an enum in AS.

I get this.

AS Error: ShipView (29, 3) Expected expression value
AS Error: ShipView (29, 3) Instead found 'enum'

For this.

void Baz()
{
   enum Foo
   {
      BAR
   };
}

 

Share this post


Link to post
Share on other sites

I don't know whether AngelScript intends to support enums within function scope, but today it doesn't. Put your enum outside the function scope and it'll work.

enum Foo
{
   BAR
};


void Baz()
{
}

Share this post


Link to post
Share on other sites

I plan on eventually adding support for declaring types as members of classes, e.g. enums and funcdefs. However this is currently not on the top of my priority list.

 

Declaring types locally in functions is probably not going to happen, unless someone comes up with a very strong argument for this need.

Share this post


Link to post
Share on other sites

This topic is 1191 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this