; Plays a wave file when ^G comes thru port  v1.00

;*******************************************************************************
;* Written by:  Symantec ASPECT Assist                                       *
;*                                                                           *                                                                             
;* This script file will give the user the option of either capturing data   *
;* in half hour increments, or in 24 hour increments. The Capture file will  *
;* close after a predefined period of inactivity on the port.                *
;*                                                                           *
;* This ASPECT script is intended only as a sample of ASPECT programming.    *
;* Symantec makes no warranty of any kind, express or implied, including     *
;* without limitation, any warranties of merchantability and/or fitness      *
;* for a particular purpose.  Use of this program is at your own risk.       *
;*                                                                           *
;* Technical Support is not provided on this script.                         *                                                                          *
;*****************************************************************************




;*******************************************************************************
;*   GLOBAL VARIABLES                                                          *
;*******************************************************************************

string szWavefile = "bell.wav"           ; Name of the wave file to play.
string szCommand  = "SOUND "             ; Command to issue to MCI.



;*******************************************************************************
;*                                                                             *
;* MAIN                                                                        *
;* This procedure sets up the MCI command that will be used to play the WAVE   *
;* file. Then it loops patiently waiting for a ^G to come through the port.    *
;* When it does, MAIN calls PlayBell to execute the MCI command.               *
;*                                                                             *
;* Globals: NONE                                                               *
;* Calls: PlayBell                                                             *
;* Called by: NONE                                                             *
;*                                                                             * 
;*******************************************************************************

proc Main
   strcat szCommand szWavefile           ; Add file name to MCI command.
   when target 0 "^G" call PlayBell      ; Wait for a ^G, then play the bell.
   while 1                               ; Loop while waiting.
      yield
   endwhile
endproc



;*******************************************************************************
;*                                                                             *
;* PlayBell                                                                    *
;* This procedure waits until called by main. When PlayBell is called, it      *
;* executes the MCI command to play the bell tone.                             *
;*                                                                             *
;* Globals:  NONE                                                              *
;* Calls:    NONE                                                              *
;* Called by:  Main                                                            *
;*                                                                             *
;*******************************************************************************
proc PlayBell
   mciexec szCommand                   ; Execute command and play sound.
endproc
