Advertisement

Values of enum constants

Started by March 09, 2017 09:17 AM
1 comment, last by IronHawk 7 years, 8 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!

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

Advertisement

Very good!

Thank you.

This topic is closed to new replies.

Advertisement