Global Initializers Must Be Constant?
BlitzMax Forums/BlitzMax Beginners Area/Global Initializers Must Be Constant?
| ||
EDIT: Don't worry about it. I just ripped out a huge section of code and rewrote it rather than spend hours trying to figure out why the debugger was reporting an error at least 5,000 lines away from the actual problem code. |
| ||
I HATE THAT It is caused by putting a global array in a type, which apparently isn't allowed |
| ||
it isn't a problem You just can't do type global something:type = type.create () end type or similar but you can simply add a type global something:type method new () if something = null something = type.create () end method end type as it is normal in OO (aka initialize stuff in constructor) |
| ||
hey, heres the problemType guy Field name:String Global array[99] EndType Function hi() Print "hi" EndFunction Function DontPickOnMe() EndFunction |
| ||
http://blitzbasic.com/Community/posts.php?topic=48801#542955 |
| ||
Aha, well then yes, I think I did make this "mistake" in my old code. When I rewrote it, I evidently didn't repeat myself, because it's fine now. I agree that it should be possible and Mark's proposed solution, doing it before anything else, works for me. |