⚠ Cookies ⚠

By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.

Projects

AGS EngineScriptselse without if
RadiantThe 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.
GurokI 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.
© Adventure Game Studio 2024. Page design by loominous and Darth Mandarb; coding by AGA.
Page generated on 07 May 2024 at 02:08:44