473,700 Members | 2,773 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1192
Please ignore, found the problem (with ns) as System has its own DayOfWeek

"Pohihihi" <po******@hotma il.com> wrote in message
news:uE******** *******@tk2msft ngp13.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******@hotma il.com> wrote in message
news:uE******** *******@tk2msft ngp13.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.Day sOfWeek
cheers,

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

"Pohihihi" <po******@hotma il.com> wrote in message
news:uE******** *******@tk2msft ngp13.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.c om> wrote in message
news:eB******** ********@TK2MSF TNGP09.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******@hotma il.com> wrote in message
news:uE******** *******@tk2msft ngp13.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
37074
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 explicitly say about enum's forward declaration, but one example shows it in 18.2.1, clause 4:
0
1738
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 consecutive values. The problem is that some functions should only accept some of the ranges. To store values of more than one range/enum in variable one has to use int as storage which imho compromises type safety because any function that wants to...
6
796
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 (this is why I started the TOKEN enum off at '1000' so I had plenty of space at the
21
4593
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
11355
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
12382
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
23600
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 FOO_STORE to be, say -10, I get a warning about unsigned comparison and I'm seeing an infinite loop. If I do initialize FOO_STORE = -10, I don't see any warnings. No infinite loop.
8
1933
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 the array m_columnBlowStep is string because I have used ToString on each enum item as you can see. I want to use enum in the case statment in the switch. I know I can use string but I rather want to use enum.
13
18135
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 detail, the enum is declared as, namespace test{ enum MyEnum{ VALUE1,VALUE2 };
3
12267
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: public enum Days { Sunday };
0
9203
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8958
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8912
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7797
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6557
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2021
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.