
December 21st, 2000, 09:16 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,578
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
conversion functions
<i><b>Originally posted by : Quintin (quintin@cambridgec.com)</b></i><br />This is what I'm trying to do. I have a C# component that has a member function. Said function has a switch statement that uses an enumeration for comparison values. When I try to build I get this error:<br /><br />Cannot implicitly convert type 'myProject.myComponent.eMENU' to 'int'<br /><br />Here's the declaration I used for my enum:<br /><br />public enum eMENU: int<br />{<br /> TITLE = 1,<br /> HEADING,<br /> SUBHEADING,<br /> MENUITEM<br />}<br /><br />Here's the opening of my switch statement:<br /><br />switch(Int32.Parse(tempMenuItem["menuItemType"].ToString()))<br />{ case eMENU.TITLE:<br /><br />Also... anyone know what the C# equivilent to the old Chr() function is? I'm generating html to output, and it would be nice to have some line breaks to make the source readable...<br /><br />If you're fairly new to this too, maybe this will help. I just had a number in a database that I was trying to do math with, took me a while to find the proper function to treat it like the number it was:<br /><br />Int32.Parse(menuDeclaration["menuTotalWidth"].ToString())<br />
|