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.
 
Back
Top