473,397 Members | 1,985 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,397 software developers and data experts.

Debugger showing wrong values for enum

Hi folks

If I write a KeyDown handler and check the KeyCode for Keys.Insert, the
debugger shows the value as Keys.LButton | Keys.MButton | Keys Back |
Keys.Space.

This is perfectly understandable since Keys.Insert = 45 and 1 + 4 + 8 + 32
also equals 45. However, it would be really nice if the debugger showed both
the combined value as well as the Flags attribute split value.

Is there any way to change the debugger view, or is this something that
needs fixing in an update ?

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Oct 4 '06 #1
2 1690
Hi Joanna,

I believe the debugger is simply displaying the result of Enum.ToString(). Try eKeys.ToString("G") to display the named constant
with the current value.

In VS.NET 2005 a visualizer can display both the constant and flag values as you requested. Unfortunately, you have to write it ;)

Visualizers in VS.NET 2005 on MSDN:
http://msdn2.microsoft.com/en-us/library/zayyhzts.aspx

--
Dave Sexton

"Joanna Carter [TeamB]" <jo****@not.for.spamwrote in message news:%2****************@TK2MSFTNGP06.phx.gbl...
Hi folks

If I write a KeyDown handler and check the KeyCode for Keys.Insert, the
debugger shows the value as Keys.LButton | Keys.MButton | Keys Back |
Keys.Space.

This is perfectly understandable since Keys.Insert = 45 and 1 + 4 + 8 + 32
also equals 45. However, it would be really nice if the debugger showed both
the combined value as well as the Flags attribute split value.

Is there any way to change the debugger view, or is this something that
needs fixing in an update ?

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer


Oct 5 '06 #2
"Dave Sexton" <dave@jwa[remove.this]online.coma écrit dans le message de
news: Od**************@TK2MSFTNGP03.phx.gbl...

| Hi Joanna,
|
| I believe the debugger is simply displaying the result of Enum.ToString().
Try eKeys.ToString("G") to display the named constant
| with the current value.
|
| In VS.NET 2005 a visualizer can display both the constant and flag values
as you requested. Unfortunately, you have to write it ;)
|
| Visualizers in VS.NET 2005 on MSDN:
| http://msdn2.microsoft.com/en-us/library/zayyhzts.aspx

Hmmm, I think that will have to take a back shelf for now, I will play with
that when I get more free time :-)

Thanks for the link to the tutorial.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Oct 5 '06 #3

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

Similar topics

4
by: news.microsoft.com | last post by:
Hi, In the debug Auto and Locals window the value that has changed becomes highlighted in red, BUT the Watch window does no highlighting, why the inconsistency? Would it not be better if this...
1
by: Chiller | last post by:
Ok, I've implemented a few changes to the code and the bool functions now seem to be functioning correctly; however, I think I'm doing the convertions incorrectly because the values printed out...
30
by: Philippe Bertrand | last post by:
Is this a bug in the C# compiler or CLR runtime? enum MyEnum { ZERO = 0, ONE = 1, TWO = 2 } class Foo { public Foo(string,object) { ... } public Foo(string,MyEnum) { ... } } Foo f = new...
5
by: Peter Oliphant | last post by:
Not a big deal, but it looks like the runtime debugger 'inspects' (e.g., Autos window) user-defined enum's as having <undefined value>, even though the execution seems to recognize their value just...
6
by: Ken | last post by:
When running a program in the debugger, what would cause it to crash without any error messages? I get "The program has exited with code 0 (0x0)". The program is a MDI app with threading for...
27
by: Ben Finney | last post by:
Antoon Pardon wrote: > I just downloaded your enum module for python > and played a bit with it. IMO some of the behaviour makes it less > usefull. Feedback is appreciated. I'm hoping to...
18
by: R. Bernstein | last post by:
Okay, a bit of an exaggeration. Recently, I've been using Python more seriously, and in using the debugger I think one of the first things I noticed was that there is no "restart" ("R" in...
0
by: ASP Developer | last post by:
I have a web service that returns a class when a web method is called. This class has a enum property with four values. These four values have default numbers. For example, Apple = 5 Orange...
12
by: Arcticool | last post by:
Can anyone tell me why j never shows up in my locals window? 32 is printed to console so I know the assignment is working. I was under the impression that I could see everything as it happens by...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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,...
0
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...

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.