Re: try catch question
- From: Rory Becker <RoryBecker@xxxxxxxxxxxxxxxx>
- Date: Thu, 26 Apr 2007 19:23:06 +0000 (UTC)
I know this will sound like a really stupid question, but here goes. I
am in the middle of debugging someone else's code and am getting more
confused by the second. Does the try catch require an "end Try"?
There are try's and catches everywhere, but no end trys.
If when you get finished having a good laugh and feel up to posting a
reply, I would be most grateful for any advice.
Oh and if anyone knows of a quick way to check that braces match up -
I think the squiggly braces aren't always paired as they should be.
Hey Dawn I think you're reading c# code not vb.net
So your code might look like
-------------------------------------------------------------
try
{
// try something
}
catch exception ex
{
// do some catch stuff
}
-------------------------------------------------------------
However the nature of c# allows for the braces to be placed on other lines thus...
-------------------------------------------------------------
try { // try something
}
catch exception ex {
// do some catch stuff
}
-------------------------------------------------------------
Note that the opening braces are not parrallel with the closing ones.
In this case (c#), the end brace '}' is equivilent to 'End Try'
I hope this helps
--
Rory
.
- Follow-Ups:
- Re: try catch question
- From: dawn13
- Re: try catch question
- References:
- try catch question
- From: dawn13
- try catch question
- Prev by Date: Re: try catch question
- Next by Date: Re: Deleting a Row from the Data Source with Table Adapter
- Previous by thread: Re: try catch question
- Next by thread: Re: try catch question
- Index(es):
Relevant Pages
|