I just tried
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
begin
{$IFDEF CONSOLE}
beep;
{$ENDIF}
end.
and expected to hear a beep
during runtime, but not. The following test works, though:
if IsConsole then
beep;
Why doesn't the compile-time test work? As far as I can understand from this doc, it sure should work.