Legacy GM Macro/Constant of Project vs Extension difference bug(?)...

ZeDuval

Member
Hey friends!

Whoever would accuse me of being a Macro/Constant-addict, would be right. I love 'em and use 'em very often to "hide" variables with long names for example. A GM-project can have constants, accessible in the ressource tree structure in a menu, which must btw be the worst menu ever created. There is also the possibility to add constants to an Extension, so you can use them in an Extension and have them packaged with the rest.
However, i found a difference in the way these two kinds of constants behave and it's giving me a headache right now.

The difference: You can create a Project-Constant 'WHATEVER1' with the value 'my_whatever_variable_1' and then use it as an array like this:
Code:
WHATEVER1[0] = "banana"; WHATEVER1[1] = "apple";
If you try to do the same with an Extension-Constant, you get the message
ERROR at line x pos y: Assignment operator expected.
at the bottom of the scripting window.

1.) Is there a possibility to add a Project-Constant to an Extension-user other then " Please create the Constant 'WHATEVER1' with the value 'my_whatever_variable_1' , otherwise nothing will work!"

2.) Is there another workaround?

3.) Is this to be considered as a bug, which should be reported?

SD

edit: Found another difference: With Project-Constants, you can use dot-notation like
Code:
SOME_OBJECT.some_var = "Knäckebrot";
with SOME_OBJECT being a referene to an object instance. This is also not possible with Extension-Constants, it seems. =/
 
Last edited:
Top