473,671 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Incorrect String Debug/Watch Info

It's possible to print out a string's Length property in my code like so:

string asdf = "asdf\0asdf ";
Console.WriteLi ne(asdf); // = "asdf asdf"
Console.WriteLi ne(asdf.Length) ; // = 9

However if you try to use the VS.NET debugger's Watch to inspect this,
you'll see that asdf is displayed as "asdf" and asdf.Length is displayed as
4, not 9.

Now I can understand (though not approve of) the IDE's inability to display
the former correctly. However, why doesn't the IDE read from the actual
Length property of the asdf String object (and instead re-calculate the
length on its own)?

And will any of these problems be fixed?
Jul 19 '05 #1
3 1726
OvErboRed <ov*********@SP AMoverbored.net > wrote:
It's possible to print out a string's Length property in my code like so:

string asdf = "asdf\0asdf ";
Console.WriteLi ne(asdf); // = "asdf asdf"
Console.WriteLi ne(asdf.Length) ; // = 9

However if you try to use the VS.NET debugger's Watch to inspect this,
you'll see that asdf is displayed as "asdf" and asdf.Length is displayed as
4, not 9.

Now I can understand (though not approve of) the IDE's inability to display
the former correctly. However, why doesn't the IDE read from the actual
Length property of the asdf String object (and instead re-calculate the
length on its own)?

And will any of these problems be fixed?


I thought these problems were fixed in VS.NET 2003 - which version are
you using?

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Jul 19 '05 #2
I'm using the original VS.NET. Is there an (official) comprehensive list of
bugs found/fixed anywhere?

Jon Skeet <sk***@pobox.co m> wrote in
news:MP******** *************** *@news.microsof t.com:
I thought these problems were fixed in VS.NET 2003 - which version are
you using?


Jul 19 '05 #3
OvErboRed <ov*********@SP AMoverbored.net > wrote:
I'm using the original VS.NET. Is there an (official) comprehensive list of
bugs found/fixed anywhere?


Not that I've seen, I'm afraid - although that doesn't mean there isn't
one somewhere.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Jul 19 '05 #4

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

Similar topics

2
2561
by: Senthoorkumaran Punniamoorthy | last post by:
I am printing these information. print string.lower(info_res) print string.lower(md5sum(f_md5)) print len(string.lower(info_res)) print len(string.lower(md5sum(f_md5))) print str(string.lower(md5sum(f_md5)) == string.lower(info_res)) and the output are
8
2687
by: Davy | last post by:
Hi all, I use VC and gcc/gdb to compile and debug C/C++ files. But I found some of the debug version of the compiled files are too large to be run in a small RAM. Can I compile C/C++ Debug partially? Something like: fileA.c fileB.c And I can compile fileA.c with debug info and compile fileB.c without debug info?
3
263
by: OvErboRed | last post by:
It's possible to print out a string's Length property in my code like so: string asdf = "asdf\0asdf"; Console.WriteLine(asdf); // = "asdf asdf" Console.WriteLine(asdf.Length); // = 9 However if you try to use the VS.NET debugger's Watch to inspect this, you'll see that asdf is displayed as "asdf" and asdf.Length is displayed as 4, not 9.
19
9506
by: David zhu | last post by:
I've got different result when comparing two strings using "==" and string.Compare(). The two strings seems to have same value "1202002" in the quick watch, and both have the same length 7 which I have tried to print out by debug.writeline(). But the "==" operator results false, and string.Compare() results true. Somebody helps me!
6
1869
by: Greg Merideth | last post by:
While I can't post all of the code I'll post snippets but, it appears that C# is *not* assigning a string, inside of a class, a value that I am passing to it using its public set method and I can't for the life of me figure out why. I have a class, call it Class Test with a private string _a and a public member string a with a get{ return value; } set{ _a = value; } I have a method, call it MyMethod() that returns a string If I...
7
2169
by: Brad | last post by:
When debugging my current web project, in VS2003, I found I had lost the ability to drill down on watch objects in the Watch Window; I could only view the single value specific watch objects. Here's what I discovered. In addition to my main web project and several middle tier projects, I also added an "empty" web project in my solution (Add - New Project - Empty Web Project). This empty web project is what is causing the above...
3
3339
by: murphy | last post by:
Hi, I've been seeing two symptoms with my asp.net site that have started recently after a long period of smooth running. As others on our team make changes to referenced dll's I find that I get the following errors from time to time. Apparently the following procedure alleviates the problems:
4
3182
by: Laurel | last post by:
Is there a way, in the debugger, to look at the contents of a dataset? I tried drilling down into my dataset and it's like exploring the registry! Anyway, I didn't find anything useful. The code I use to fill the dataset is below. The dataset fills OK and is usable. I just want to know how it names things, e.g., if there are multiple instances of a column of the same name, etc. Right now it can't find Person.Person_ID, although that is...
15
5204
geolemon
by: geolemon | last post by:
I'm having a seriously Twilight Zone moment: In the code below, I'm building a SQL command into a string variable, declared at the top of my code. Then, I connect to the database and try to execute the SQL code. Here's the corresponding snippets: 'declare variables: Dim strProc As String
0
8909
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...
0
8819
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8596
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
8667
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
7428
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...
0
5690
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
4221
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...
0
4399
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2048
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.