[fpc-pascal]Yet another bug in Win32 CRT unit

Rich Pasco pasco at acm.org
Fri Mar 8 04:46:46 CET 2002


Here's a beeping program that compiles under Borland Pascal for DOS
and Free Pascal for Win32 and sounds the same on both.  What eludes
me is how to code a unit that implements sound() and delay() by calling
windows.beep().

     - Rich

{$ifdef WIN32}
  uses Windows;
{$else}
  uses CRT;
{$endif}

begin
{$ifdef WIN32}
  beep(1000,1000);
  beep(500,1000);
{$else}
  sound(1000);
  delay(1000);
  sound(500);
  delay(1000);
  nosound;
{$endif}
end.




More information about the fpc-pascal mailing list