Function Tone() Foundation

Produces a speaker tone with specific tone frequency and duration.

Syntax
Tone( <nFrequency>, [<nDuration>] ) --> NIL
Parameters
<nFrequency>
<nFrequency> is a positive numeric expression which indicates the frequency of the tone produced.
<nDuration>
The optional numeric argument <nDuration> specifies the duration of the tone in 2/18 second increments. The value 9 for <nDuration>produces a tone for a duration of one second.
Return

The return value of Tone() is always NIL.

Description

The environment function Tone() produces a tone signal to alert the user to a specific program condition. Common program conditions for which tone signals are useful are reaching the start or end of a file, termination of a timed procedure or when the user has selected a control element not available at that time.

The ASCII character 7 (Chr(7)) can also be used for outputting a warning tone. When it is displayed with QOut() or ? , a warning tone sounds instead of a visible display.

Examples
Tone()
// The example shows various UDFs which can signal 
// specific program condition 

PROCEDURE Main 

   BofTone() 
   EofTone() 
   ErrorTone() 
   DoneTone() 

RETURN 

PROCEDURE BofTone() 
   Tone(800) 
RETURN 

PROCEDURE EofTone() 
   Tone(500) 
RETURN 

PROCEDURE ErrorTone() 
   Tone(1000,3) 
RETURN 

PROCEDURE DoneTone() 
   Tone(100,3) 
   Tone(200,3) 
   Tone(300,3) 
   Tone(500,6) 
RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.