473,395 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

enum problem

enum DaysOfWeek
{ Sunday = 1, Monday = 2, Tuesday = 3, Wednesday = 4, Thursday = 5, Friday =
6, Saturday = 7 }

Enum above gives 0 for sunday and rest are one digit below then what is
assigned. What am I doing wrong?

Thanks.
Dec 8 '05 #1
5 1177
Please ignore, found the problem (with ns) as System has its own DayOfWeek

"Pohihihi" <po******@hotmail.com> wrote in message
news:uE***************@tk2msftngp13.phx.gbl...
enum DaysOfWeek
{ Sunday = 1, Monday = 2, Tuesday = 3, Wednesday = 4, Thursday = 5, Friday
= 6, Saturday = 7 }

Enum above gives 0 for sunday and rest are one digit below then what is
assigned. What am I doing wrong?

Thanks.

Dec 8 '05 #2
There is already a DaysofWeek

-------
Regards ,
C#, VB.NET , SQL SERVER , UML , DESIGN Patterns Interview question book
http://www.geocities.com/dotnetinterviews/
My Interview Blog
http://spaces.msn.com/members/dotnetinterviews/

Dec 8 '05 #3
Just one thing on this if you are using Webservices.

I found when using enums with Webservices, that they do get renumbered when
used on the client (something to do with the proxy object(s)). So

Enum Test {One = 1, Two = 2, Six = 6}

declared in the webservice on the webserver, becomes:

Enum Test {One = 0, Two = 1, Six = 3}

On the client that has created a proxy object to the webservice.

"Pohihihi" <po******@hotmail.com> wrote in message
news:uE***************@tk2msftngp13.phx.gbl...
enum DaysOfWeek
{ Sunday = 1, Monday = 2, Tuesday = 3, Wednesday = 4, Thursday = 5, Friday
= 6, Saturday = 7 }

Enum above gives 0 for sunday and rest are one digit below then what is
assigned. What am I doing wrong?

Thanks.

Dec 8 '05 #4
Hi,

Yes, it does :)

In case you want to use yours all you have to do is using the fullname :
MyNameSpace.DaysOfWeek
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Pohihihi" <po******@hotmail.com> wrote in message
news:e9****************@TK2MSFTNGP11.phx.gbl...
Please ignore, found the problem (with ns) as System has its own DayOfWeek

"Pohihihi" <po******@hotmail.com> wrote in message
news:uE***************@tk2msftngp13.phx.gbl...
enum DaysOfWeek
{ Sunday = 1, Monday = 2, Tuesday = 3, Wednesday = 4, Thursday = 5,
Friday = 6, Saturday = 7 }

Enum above gives 0 for sunday and rest are one digit below then what is
assigned. What am I doing wrong?

Thanks.


Dec 8 '05 #5
Thx for the additional info, as I don't do web related work I did not know
this, but good to know now. Thx agian.
"Paul" <no****@noone.com> wrote in message
news:eB****************@TK2MSFTNGP09.phx.gbl...
Just one thing on this if you are using Webservices.

I found when using enums with Webservices, that they do get renumbered
when used on the client (something to do with the proxy object(s)). So

Enum Test {One = 1, Two = 2, Six = 6}

declared in the webservice on the webserver, becomes:

Enum Test {One = 0, Two = 1, Six = 3}

On the client that has created a proxy object to the webservice.

"Pohihihi" <po******@hotmail.com> wrote in message
news:uE***************@tk2msftngp13.phx.gbl...
enum DaysOfWeek
{ Sunday = 1, Monday = 2, Tuesday = 3, Wednesday = 4, Thursday = 5,
Friday = 6, Saturday = 7 }

Enum above gives 0 for sunday and rest are one digit below then what is
assigned. What am I doing wrong?

Thanks.


Dec 8 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Alexander Grigoriev | last post by:
Not quite new version of GCC that I have to use, craps with the following code: enum E; enum E { e }; That is, it doesn't accept forward declaration of enum. C++ standard text doesn't...
0
by: Vaclav Haisman | last post by:
Motivation: I have been working on some project recently that uses lots of enums with disjunctive intervals of values because it is rather convenient way to define series of constants with...
6
by: James Brown | last post by:
Hi, I have the following enum declared: enum TOKEN { TOK_ID = 1000, TOK_NUMBER, TOK_STRING, /*lots more here*/ }; What I am trying to do is _also_ represent ASCII values 0-127 as TOKENs...
21
by: Andreas Huber | last post by:
Hi there Spending half an hour searching through the archive I haven't found a rationale for the following behavior. using System; // note the missing Flags attribute enum Color {
18
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! I have created an enum list like this: enum myEnum : int { This = 2, That, NewVal = 10, LastItm
13
by: Don | last post by:
How do I get an Enum's type using only the Enum name? e.g. Dim enumType as System.Type Dim enumName as String = "MyEnum" enumType = ???(enumName)
10
by: kar1107 | last post by:
Hi all, Can the compiler chose the type of an enum to be signed or unsigned int? I thought it must be int; looks like it changes based on the assigned values. Below if I don't initialize...
8
by: tony | last post by:
Hello! I have below a for loop and a switch in the for loop. I have also a enum called colBlowStep with some values. I have also an array called m_columnBlowStep with some strings. All items in...
13
by: toton | last post by:
Hi, I have some enum (enumeration ) defined in some namespace, not inside class. How to use the enum constant's in some other namespace without using the whole namespace. To say in little...
3
by: Cmtk Software | last post by:
I'm trying to define an enum which will be used from unmanaged c++, C++/CLI managed c++ and from C#. I defined the following enum in a VS dll project set to be compiled with the /clr switch: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.