>I'm having a problem sounding an error .wav tone.
>I code into a procedure to set bell to xxx.wav, set the bell on, and ? chr(7). When I do this procedure from the command prompt, the bell sounds. Notice I set the xxx.wav and turn bell on in this procedure.
>
>In a form that I am using when I get an error I do the procedure. If I run this form from the command window, I get the error sound when the condition is reached. Everything is fine.
>
>I have this form selected from a menu. If I run the menu from the project manager and then select the option for the form in question, that works too.
>
>When I run the main program to login and activate the menu, I no longer get any sound.
>
>I thought perhaps it was the read events that was causing the problem, but I issue the read events from the command window after loading the menu and I get the sound just fine.
>
>You will notice that I put an on key label f9 in to test ringing of the bell. It does not work
>
>The main program for the application is:
>
>
>M_cap = "Log Management System"
>_screen.caption = ""
>a = is_run32(M_cap)
>if a > 0
> _screen.WindowState=1
> =messagebox("LOG Management System is already running on this computer. Please use the running copy.",16,m_cap)
> quit
>endif
>_screen.closable = .f.
>_screen.WindowState = 2
>_screen.Caption = M_cap
>release M_cap
>set talk on
>set console off
>SET DELETED ON
>public laMills, laGrades, laSpecies, m_curmill, pcCompany, pcLocation, pcHcomPort
>* set default to c:\vfplogs
>if not used('system')
> use system in 0
>endif
>pcCompany = system.coname
>pcLocation = system.locname
>m_curmill = system.mill
>pcHcomPort = system.hcomport
>use
>
>dimension laMills(40), laSpecies(50), laGrades(50)
>set century on
>do main.mpr
>
>define window x from 0,0 to 200,340 fill file backgrnd.jpg
>* define window x from 0,0 to 70,140 fill file backgrnd.jpg
>activate window x
>zoom window x max
>if file ("startmsg.txt")
> run /n notepad startmsg.txt
> do form startmsg
>endif
>
>do form login
>* on key label f9 do testbell
>on key label f9 do ringbell
>if trim(m_secure) = 'Login Failed'
> quit
>else
> read events
>endif
>
>
>
>The ringbell program is very simple
>
>
>set bell to "error.wav"
>set bell on
>?? chr(7)
>set bell to
>set bell off
>
>
>
>What other conditions or commands would effect the sounding of the bell.
>
>Any thoughts will be greatly appreciated.
Years ago I ran into similar issues - you might want to look at the short thread
API Call to ring system bell/play .WAV Thread #
258772 Message #
258772 . Probably the most reliable way to play your sound is via an API call such as Anatoliy outlines.
However, when looking through the old threads I found a tip from DraganN which might be worth a try:
?? CHR(7)
WAIT CHR(7) NOWAIT
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up