Advertisement

letting the script know a constant value in a #define macro

Started by June 22, 2008 05:39 AM
1 comment, last by jal_ 16 years, 5 months ago
Hi, I simply want to let the script know some constant values defined in macros (y'know, #define BLAH 5). I don't see it in the manual and I fail at doing it using RegisterGlobalProperty. Any hint for this? I can always change the way they are defined in the code, but I thought I could ask first. Thnx in advance.
A #define macro is replaced with the value it's define to everywhere it's used at preprocessor time. This means it doesn't really exist anywhere in memory, so AngelScript doesn't have anything to bind to. To be able to bind it as a global, you need it to be in a variable (like "static const int blah = 5" or so).

Hope that helps :)
Advertisement
Ye, thought so. I'll register them as enums I guess.

This topic is closed to new replies.

Advertisement