<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Testing for enums</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Testing for enums</description>
  <pubDate>Fri, 12 Jun 2026 00:11:05 -700</pubDate>
  <lastBuildDate>Thu, 09 Aug 2007 18:29:03 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=358</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Testing for enums : testentity.Status.ID = testentitystatus.Ready.ID...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=358&amp;PID=908#908</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=65" rel="nofollow">brianlj</a><br /><strong>Subject:</strong> 358<br /><strong>Posted:</strong> 09-Aug-2007 at 6:29pm<br /><br />testentity.Status.ID&nbsp; = testentitystatus.Ready.ID is what I ended up doing and I believe should work just fine.&nbsp; However, it would be nice if you could just compare the enum entities directly and not have to know the specific fields when trying to compare. I know, I know..... in a perfect world......just seems like DevForce should have all the info it needs to support this functionality.......<DIV>&nbsp;</DIV><DIV>Thanks to all that provided some input here......<BR></DIV>]]>
   </description>
   <pubDate>Thu, 09 Aug 2007 18:29:03 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=358&amp;PID=908#908</guid>
  </item> 
  <item>
   <title>Testing for enums : Try doing something like testentity.Status.ID...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=358&amp;PID=903#903</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=54" rel="nofollow">jsmark</a><br /><strong>Subject:</strong> 358<br /><strong>Posted:</strong> 09-Aug-2007 at 1:29pm<br /><br />Try doing something like testentity.Status.ID&nbsp; = testentitystatus.Ready.ID <br>(ID being the identity field in the database)]]>
   </description>
   <pubDate>Thu, 09 Aug 2007 13:29:40 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=358&amp;PID=903#903</guid>
  </item> 
  <item>
   <title>Testing for enums : Yes, you are correct that &amp;#039;Is&amp;#039;...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=358&amp;PID=901#901</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=65" rel="nofollow">brianlj</a><br /><strong>Subject:</strong> 358<br /><strong>Posted:</strong> 09-Aug-2007 at 10:21am<br /><br />Yes, you are correct that 'Is' does a literal object compare.&nbsp; But since DevForce uses cached objects, my thought is they should be one in the same object.&nbsp; And this seems to be true MOST of the time, but I have had bugs that I have traced back to this compare failing.&nbsp; And unfortunately, I don't believe there is an operator overload for '='; I could probably write my own, but was trying to avoid doing this for every enum.<DIV>&nbsp;</DIV><DIV><DIV></DIV><DIV></DIV><DIV></DIV>I have of course debugged and made sure the status is what I expect.&nbsp; </DIV>]]>
   </description>
   <pubDate>Thu, 09 Aug 2007 10:21:49 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=358&amp;PID=901#901</guid>
  </item> 
  <item>
   <title>Testing for enums : My VB.NET isn&amp;#039;t as polished...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=358&amp;PID=895#895</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=41" rel="nofollow">wdevine</a><br /><strong>Subject:</strong> 358<br /><strong>Posted:</strong> 08-Aug-2007 at 3:22pm<br /><br /><DIV>My VB.NET isn't as polished as it should be, but I think I'd use something like this:</DIV><DIV>&nbsp;</DIV><DIV><FONT color=#0066cc>If testentity.status = testentitystatus.Ready then</FONT></DIV><DIV>&nbsp;</DIV><DIV>I'm not 100% sure, but I think the 'Is' operator in the context that it is being used is and object compare.</DIV><DIV>&nbsp;</DIV><DIV>Bill&nbsp; </DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 08 Aug 2007 15:22:10 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=358&amp;PID=895#895</guid>
  </item> 
  <item>
   <title>Testing for enums : Hi Brian,  Have you put a break...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=358&amp;PID=891#891</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=24" rel="nofollow">Linguinut</a><br /><strong>Subject:</strong> 358<br /><strong>Posted:</strong> 08-Aug-2007 at 12:55pm<br /><br />Hi Brian,<DIV>&nbsp;</DIV><DIV>Have you put a break on that line to see what the actual values are for each of the test subjects?&nbsp; testentity.status must be returning something other than testentitystatus.Ready for it to return false.&nbsp; I state the obvious.&nbsp; Perhaps you can trace back from the breakpoint why the status property has not changed by that point in the code.</DIV><DIV>&nbsp;</DIV><DIV>Bill</DIV>]]>
   </description>
   <pubDate>Wed, 08 Aug 2007 12:55:25 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=358&amp;PID=891#891</guid>
  </item> 
  <item>
   <title>Testing for enums : Hi - I have some problems when...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=358&amp;PID=884#884</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=65" rel="nofollow">brianlj</a><br /><strong>Subject:</strong> 358<br /><strong>Posted:</strong> 08-Aug-2007 at 8:46am<br /><br />Hi -<DIV>I have some problems when I try to test the value of an enum in code.&nbsp; For example, I use:</DIV><DIV>&nbsp;</DIV><DIV>If testentity.status Is testentitystatus.Ready then</DIV><DIV>.....</DIV><DIV>end if</DIV><DIV>&nbsp;</DIV><DIV>This seems to work MOST of the time, but inexplicably fails to return TRUE at times (when I know the status is READY).</DIV><DIV>&nbsp;</DIV><DIV>Any thoughts?&nbsp; Should I be testing differently?</DIV><DIV>Thanks!</DIV>]]>
   </description>
   <pubDate>Wed, 08 Aug 2007 08:46:43 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=358&amp;PID=884#884</guid>
  </item> 
 </channel>
</rss>