Contents Previous Next Subchapters

Generating Sounds
Syntax beep
frequency, duration)
See Also errortrap

Generates a tone on the speaker (provided that sound is enabled). If present, the integer scalars frequency and duration, specify the frequency of the tone in hertz and the duration of the tone in milliseconds, respectively. The frequency must be between 37 and 32,767. If frequency and duration are not specified, the frequency will be 1,000 Hz and the duration will be 1,000 ms (if your system supports variation in the frequency and duration of sounds).

The return value will be true if the beep succeeds and false otherwise.

If you enter
a beep will sound and T will print in the command window. If you enter
     for i = 1 to 20 begin
          beep(100 * i, 50);
a sliding tone will play on your computer. (Note that the semi-colon suppresses the printing of the return value from beep.)