PROBLEM
AGK 108.11 no longer allows global variables to be declared and initialized, as follows:
global g_iMaxSprites as integer = 600 // <-- an initializing declaration
global dim g_SpriteGroup[g_iMaxSprites] as integer // <-- array declaration that uses the above value
After the initializing declaration, the value of "g_iMaxSprites" will be 0, instead of 600.
So, as a consequence, on the following line the array will be initialized to zero elements.
(The incorrect value of g_iMaxSprites caused havoc later in the code where the snippet is from.)
Using AppGameKit 108.11 TIER1 compiler there will be no compiler warnings or errors!
The initialization statement (= 600) after the declaration is simply IGNORED by the compiler.
RECENT CHANGES
The code snippet above used to work with the TIER1 compiler on AppGameKit 107.6!
I've just tried upgrading some older projects from 107.6 to 108.11 but all I've run into is problems.
Code that used to work, no longer does, and I'm getting reduced 2D performance! I'm absolutely distraught!
RELATED ISSUES
Issue 468: Single-line array declaration not functional in 1088 beta
* Reported Jan 15, 2013
Issue 304: Tier 1 basic compiler silently fails to initialize declared variable when using calculated value.
* Reported: May 12, 2012
Issue 35: Global Declarations using math operations produce the wrong result
* Reported: Sep 9, 2011
OTHER FEEDBACK
Amazing how these compiler issues keep resurfacing year after year.
On a positive note, I do have to say I'm pleased to see that Paul has really been working hard lately.
Many of the issues on the AppGameKit issues list have been fixed - or are being worked on. This is great.
But I don't really have time to do free product testing and bug reporting for TGC.
I would actually like to have a stable dev environment that I can use for development. Darnit.
I'll be adding this report to the AppGameKit issues list, as soon as others have confirmed it.
(I'm leaving some room for the possibility that I'm just tired and made a mistake myself.)
FOR TESTERS
I've attached a small .zip file with ready-to-compile source for confirming the bug.
Cheers,
AgentSam