Harbour All Functions – T

TabExpand
TabPack

Tan

TanH

TBrowseDB

TBrowseNew

TFileRead

THtml

Time

TimeValid

TNortonGuide 

Token
TokenAt
TokenEnd
TokenExit
TokenInit
TokenLower
TokenNext
TokenNum
TokenSep
TokenUpper

Tone

TOs2

Transform
Trim

TRtf

TTroff

 Type

Tone()

Tone()

Sound a tone with a specified frequency and duration.

Syntax

      Tone( <nFrequency>,  <nDuration> ) --> NIL

Arguments

<nFrequency> A non-negative numeric value that specifies the frequency of the tone in hertz.

<nDuration> A positive numeric value which specifies the duration of the tone in 1/18 of a second units.

Returns

Tone() always returns NIL.

Description

Tone() is a sound function that could be used to irritate the end user, his or her dog, and the surrounding neighborhood. The frequency is limited to the range 0 to 32767 Hz.

Examples

      IF lOk   // Good Sound
         Tone(  500,  1 )
         Tone( 4000,  1 )
         Tone( 2500,  1 )
      ELSE     // Bad Sound
         Tone(  300,  1 )
         Tone(  499,  5 )
         Tone(  700,  5 )
      ENDIF
      //
      Tone( 800,  1 )                         // same as ? Chr( 7 )
      Tone( 32000,  200 )                     // any dogs around yet?
      Tone( 130.80,  1 )                      // musical note - C
      Tone( 400,  0 )                         // short beep
      Tone( 700 )                            // short beep
      Tone( 10,  18.2 )                       // 1 second delay
      Tone( -1 )                             // 1/18.2 second delay
      Tone()                                 // 1/18.2 second delay

Compliance

Clipper

Platforms

All

Files

Library is core

Seealso

Chr(), SET BELL

C5_TONE

 TONE()
 Sound a speaker tone for a specified frequency and duration
------------------------------------------------------------------------------
 Syntax

     TONE(<nFrequency>, <nDuration>) --> NIL

 Arguments

     <nFrequency> is a positive numeric value indicating the frequency of
     the tone to be sounded.

     <nDuration> is a positive numeric value indicating the duration of
     the tone measured in increments of 1/18 of a second.  For example, an
     <nDuration> value of 18 represents one second.

     For both arguments, non-integer values are truncated--not rounded--to
     their integer portion.

 Returns

     TONE() always returns NIL.

 Description

     TONE() is a sound function that indicates various program states to the
     user.  These can be error states, boundary conditions, or the end of a
     time-consuming process.  For example, an error state would sound an
     error tone before alerting the user with a message or interactive dialog
     box.  A boundary condition might indicate that the user is attempting to
     move the cursor past the top or bottom of a column in a TBrowse object.
     A batch process also might indicate its completion with a sound to alert
     the user, in case the user has turned away from the screen.

     TONE() works by sounding the speaker at the specified frequency for the
     specified duration.  The duration is measured in increments of 1/18 of a
     second.  The frequency is measured in hertz (cycles per second).
     Frequencies of less than 20 are inaudible.  The table below shows the
     frequencies of standard musical notes.

     Note:  TONE() works only on IBM PC and 100 percent compatible
     computers.

     Table of Musical Notes
     ------------------------------------------------------------------------
     Pitch   Frequency    Pitch     Frequency
     ------------------------------------------------------------------------
     C       130.80       mid C     261.70
     C#      138.60       C#        277.20
     D       146.80       D         293.70
     D#      155.60       D#        311.10
     E       164.80       E         329.60
     F       174.60       F         349.20
     F#      185.00       F#        370.00
     G       196.00       G         392.00
     G#      207.70       G#        415.30
     A       220.00       A         440.00
     A#      233.10       A#        466.20
     B       246.90       B         493.90
                          C         523.30
     ------------------------------------------------------------------------

 Examples

     .  This example is a beep function that indicates that a batch
        operation has completed:

        FUNCTION DoneBeep
           TONE(300, 1)
           TONE(100, 1)
           TONE(300, 1)
           TONE(100, 1)
           RETURN NIL

     .  This example is a tone sequence that indicates invalid
        keystrokes or boundary conditions:

        FUNCTION ErrorBeep
           TONE(100, 3)
           RETURN NIL

 Files   Library is EXTEND.LIB, source file is SOURCE\SAMPLE\EXAMPLEA.ASM.

See Also: SET BELL



C5 Environment Commands and Functions

Commands :

SET BELL :

Toggle automatic sounding of the bell during full-screen operations

SET BELL on | OFF | <xlToggle>

SET COLOR :

Define screen colors

SET COLOR | COLOUR TO [ [<standard>]
    [, <enhanced>] [, <border>] [, <background> ]
    [, <unselected>]] | ( <cColorString> )

SET DEFAULT :

Set the default drive and directory

SET DEFAULT TO [ <xcPathspec> ]

SET FUNCTION :

Assign a character string to a function key

SET FUNCTION <nFunctionKey> TO <cString>

SET TYPEAHEAD :

Set the size of the keyboard buffer

SET TYPEAHEAD TO <nKeyboardSize>

Functions :

CURDIR() :

Return the current DOS directory

CURDIR( [ <cDrivespec> ] ) --> cDirectory

DISKSPACE() :

Return the space available on a specified disk

DISKSPACE( [ <nDrive> ] ) --> nBytes

FKLABEL()* :

Return function key name

FKLABEL( <nFunctionKey> ) --> cKeyLabel

FKMAX()* :

Return number of function keys as a constant

FKMAX() --> nFunctionKeys

GETENV() :

Retrieve the contents of a DOS environment variable

GETENV( <cEnvironmentVariable> ) --> cString

ISCOLOR() :

Determine if the current computer has color compatibility

ISCOLOR() | ISCOLOUR() --> lBoolean

MAXROW() :

Determine the maximum visible screen row

MAXROW() --> nRow

MAXCOL() :

Determine the maximum visible screen column

MAXCOL() --> nColumn

MEMORY() :

Determine the amount of available free pool memory

MEMORY( <nMemoryType> ) --> nKbytes

NOSNOW() :

Toggle snow position

NOSNOW( <lToggle> ) --> NIL

OS() :

Return the operating system name

OS() --> cOSName

SET() :

Inspect or change a global setting

SET( <nSpecifier>, [<expNewSetting>], [<lOpenMode> ] )
      --> CurrentSetting

TONE() :

Sound a speaker tone for a specified frequency and duration

TONE( <nFrequency>, <nDuration> ) --> NIL

VERSION() :

Returns Clipper Compiler version

VERSION() --> cVersion