Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Related Posts

You learn something new everyday...

Posted on July 25th
Ok, I know that Paul knew this, but did anyone else notice that the VB.NET Try...Catch syntax includes a 'when' clause?
    Try
       [ tryStatements ]
    [ Catch [ exception [ As type ] ] [ When expression ] 
       [ catchStatements ] ]
    [ Exit Try ]
    ...
    [ Finally
       [ finallyStatements ] ]
    End Try
    When
    Optional. A Catch statement with a When clause will only catch exceptions when expression evaluates to True. A When clause is only applied after checking the type of the exception, and expression may refer to the identifier representing the exception.
I never did! I can't think of a good use for it right at this moment, but I'm still shocked that I never noticed it before... now what to do with it?


Write a Comment

Take a moment to comment and tell us what you think. Some basic HTML is allowed for formatting.

Reader Comments

Be the first to comment!