Pascal bee (chr (7)) ?

2011-03-07 1:39 am
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)

2011-03-07 8:22 am
✔ 最佳答案
emmm。 我觉得你的 looping 有点不对。
你是要等 10 次后才响 Bee 吗 ??

给个网页你参考,你写到了可以跟我分享下吗?

http://www.learn-programming.za.net/programming_pascal_learn06.html
2011-03-07 9:15 am
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 備份