Pascal bee (chr (7)) ?
How to make the computer to bee once with Pascal program?
I wrote below program but it doesn't work.
program main;
uses crt;
var a,x,b:integer;
begin
readln(a);
x:=10;
while((a=10) and (not(Keypressed)))do write(chr(7),X);
writeln;
writeln;
writeln('Bye Bye');
readln;
end.
回答 (2)
Chr(7) is Ctrl-G
Which is the BELL with a lot of console, in the old days....
The DOS box in windows is a console with lots of things missing, ctrl-G is one of them.
To make a beep, you should use the SOUND() function. The given parameter is the frequency.
To make an audible beep, try SOUND(1000); Delay(1000); NOSOUND;
It gives a 1KHz beep with a duration of 1 second.
收錄日期: 2021-04-25 13:19:19
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20110306000051KK01096
檢視 Wayback Machine 備份