Projects
AGS Engine | Scripts | else without if |
---|---|---|
Radiant | The line { RawSetColor (0); } else RawSetColor (1); surprisingly doesn't throw a compiler error. It appears to parse with an implicit "if (false) ..." meaning the part between parentheses is skipped, and the part after the else is executed. | |
Gurok | I was unable to replicate this issue. Are you sure that you provided the entire test case? I used the following code in a new empty game: [code]void RawSetColor(int a) { } // called when the game starts, before the first room is loaded function game_start() { { RawSetColor (0); } else RawSetColor (1); }[/code] Results in: PE04: parse error at 'else' Tested with 3.4.0 Patch 2 and 3.3.5, Patch 7. |