<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Use TryParse instead of Throwing Exceptions (Try {} Catch {})</title>
	<atom:link href="http://www.sharpdeveloper.net/content/archive/2007/05/25/use-tryparse-instead-of-try-catch.aspx/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sharpdeveloper.net/content/archive/2007/05/25/use-tryparse-instead-of-try-catch.aspx</link>
	<description>C# articles and tutorials on SharpDeveloper.NET</description>
	<lastBuildDate>Mon, 12 Dec 2011 15:06:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: Sameer Alibhai</title>
		<link>http://www.sharpdeveloper.net/content/archive/2007/05/25/use-tryparse-instead-of-try-catch.aspx/comment-page-1#comment-15</link>
		<dc:creator>Sameer Alibhai</dc:creator>
		<pubDate>Thu, 13 Sep 2007 10:48:00 +0000</pubDate>
		<guid isPermaLink="false">http://migrate.sharpdeveloper.net/content/?p=21#comment-15</guid>
		<description>  You are right, Thank you. Setting iEditMode = 0 inside the curly braces is not a good example. Better to do something else inside the braces such as output something or disable buttons or whatever is needed. </description>
		<content:encoded><![CDATA[<p>You are right, Thank you. Setting iEditMode = 0 inside the curly braces is not a good example. Better to do something else inside the braces such as output something or disable buttons or whatever is needed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ingvar</title>
		<link>http://www.sharpdeveloper.net/content/archive/2007/05/25/use-tryparse-instead-of-try-catch.aspx/comment-page-1#comment-14</link>
		<dc:creator>Ingvar</dc:creator>
		<pubDate>Thu, 13 Sep 2007 06:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://migrate.sharpdeveloper.net/content/?p=21#comment-14</guid>
		<description>  The example is confusing, because it may let us believe that the out-parameter is unchanged when conversion fails.

But when TryParse returns, the out parameter is zero if the conversion failed.

So if you want iEditMode = 0 when the conversion fails you may just write
Int32.TryParse(strEditMode, out iEditMode)
with no check on the return value.</description>
		<content:encoded><![CDATA[<p>The example is confusing, because it may let us believe that the out-parameter is unchanged when conversion fails.</p>
<p>But when TryParse returns, the out parameter is zero if the conversion failed.</p>
<p>So if you want iEditMode = 0 when the conversion fails you may just write<br />
Int32.TryParse(strEditMode, out iEditMode)<br />
with no check on the return value.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

