Try Catch

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

Hello,
I have a try catch block that
when the function returns no errors, I want to play a sound (1.wav)
but if it fails I want to play (2.wav)
what is the right way of doing this, or what is a way doing this
 
Brian said:
Hello,
I have a try catch block that
when the function returns no errors, I want to play a sound (1.wav)
but if it fails I want to play (2.wav)
what is the right way of doing this, or what is a way doing this

Assuming that by "returns no errors" you mean doesn't throw an exception,
play the success sound from within the try block just after the function
call, and play the failure sound from within the catch block.
 
Thanks..

PvdG42 said:
Assuming that by "returns no errors" you mean doesn't throw an exception,
play the success sound from within the try block just after the function
call, and play the failure sound from within the catch block.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top