Advertisement

Add enum value from script

Started by September 02, 2011 04:11 PM
0 comments, last by behc 13 years, 2 months ago
Would it be possible to use a enum value that was registered in the same script?


register_value("test", "test_value", 1);
int i = test_value;
I think it's not possible because test_value doesn't exist at compile time. You would have to break this code in two separate modules. Compile and execute first one with [font=CourierNew, monospace][size=2]register_value [/font][font="Arial"][size=2]calls[size=2], an[/font]d then compile second one with previously registered values.

But if all you want to do is to create an enum, why don't declare it in common way?
like (in script)
enum test
{
test_value = 1
}

This topic is closed to new replies.

Advertisement