Sure you can. You can nest the statement you expect to cause a problem in its own try block, like this:
try
{
// Lots of statements here
// Statement that might cause an error you want to ignore
try
{
DoSomething();
}
catch {}
// Lots of other statements here
}
catch {}
So, when the inner try block throws an error, the rest of the code will just continue.
HtH,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to:
The Tale of Dusty and Pistol Pete by
Smashing Pumpkins (Track 10 from the album:
Adore)
What's This?