Try Catch

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 Shafer [ Sa, 12 April 2008 06:00 ] [ ID #1941066 ]

Re: Try Catch

"Brian" <bsgallatin [at] community.nospam> wrote in message
news:uTVuRHFnIHA.6064 [at] TK2MSFTNGP03.phx.gbl...
> 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.
pvdg42 [ Sa, 12 April 2008 16:46 ] [ ID #1941071 ]

Re: Try Catch

Thanks..

"PvdG42" <pvdg [at] toadstool.edu> wrote in message
news:udPHxvKnIHA.5024 [at] TK2MSFTNGP06.phx.gbl...
> "Brian" <bsgallatin [at] community.nospam> wrote in message
> news:uTVuRHFnIHA.6064 [at] TK2MSFTNGP03.phx.gbl...
>> 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.
>
Brian Shafer [ Sa, 12 April 2008 19:48 ] [ ID #1941074 ]
Microsoft » microsoft.public.dotnet.general » Try Catch

Vorheriges Thema: Running Assembly from Network Drive
Nächstes Thema: Architecture Question - Domain Object Validation