home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / S12780.ZIP / DOSBEEP.BAS next >
BASIC Source File  |  1990-10-25  |  1KB  |  34 lines

  1.  
  2. '| *********************************************************************** |'
  3. '|                                                                         |'
  4. '| Function : DosBeep ( Frequency, Duration )                              |'
  5. '|                                                                         |'
  6. '| Description :                                                           |'
  7. '|                                                                         |'
  8. '| The BASIC SOUND statement is not supported under OS/2, instead we use   |'
  9. '| the OS/2 DOSBEEP function.                                              |'
  10. '|                                                                         |'
  11. '| *********************************************************************** |'
  12.  
  13.  
  14. DECLARE FUNCTION DosBeep%      ( BYVAL Freq%, _
  15.                                  BYVAL Durat% _
  16.                                )
  17.  
  18. SUB BSound (Freq%, Durat%)
  19.  
  20.     '|
  21.     '| BSOUND is used in the same fashion as the BASIC SOUND statement.
  22.     '|
  23.     '| It will also generate a BASIC "Illegal Function Call" when it
  24.     '| fails, just like the SOUND statement.
  25.     '|
  26.  
  27.     Rtn% = DosBeep% (Freq%, Durat%)
  28.  
  29.     IF Rtn% THEN    '| Issue an Invalid Function Call Error
  30.        ERROR 5    '| when an error occurs just like the
  31.     END IF        '| BASIC SOUND statement.
  32.  
  33. END SUB
  34.