🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Values of enum constants

Started by
1 comment, last by IronHawk 7 years, 3 months ago

Hello, Andreas!

It seems that the values of AS enums are not controlled by an AS compiler.

Although the asITypeInfo::GetEnumValueByIndex(...) function returns enum value as int (in "int *outValue") for example this code compiles:

enum MyEnum {
myValue = -9223372036854775809

}

But the actual value of myValue is far out of "int" range.

Thanks!

Advertisement

Thanks. I'll look into this and add the necessary verification that the value actually fits within the 32bits of the type.

Maybe sometime in the future I'll add support for enums of different sizes, but for now all enums are 32bits.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Very good!

Thank you.

This topic is closed to new replies.

Advertisement