Bit of VS .NET 2003...
 

Subscribe now and choose from over 30 free gifts worth up to £49 - Plus get £25 to spend in our shop

[Closed] Bit of VS .NET 2003 help please

5 Posts
4 Users
0 Reactions
48 Views
 Earl
Posts: 1902
Free Member
Topic starter
 

VS .Net 2003 to debug some C code.

In the watch window the values of my chars are being displayed as numbers only (ASCI in base10 I assume).
Is that a settting that will show me both the numerical ASCI value and the 'Alphabetical' character? ie 82 = 'R'

Hopefully I'm asking the question right as I kinda out of my depth here.


 
Posted : 16/03/2010 3:20 pm
Posts: 31206
Full Member
 

From memory you can right click and choose other display formats.
It should really show the ASCII characters for the char type , unless they are being stored as int or something, in which case you can type in a suitable cast into the Watch window.


 
Posted : 16/03/2010 3:42 pm
 nbt
Posts: 12403
Full Member
 

you can add multiple watches, but you will need to run a conversion on the string value which VS.net doesn't really like doing. best way might be to add a line which converts the char to a string and add a watch on that variable - either stick it in an IF #DEBUG so it doesn;t compile in release mode, or better still remove it when you;re sure your code works as required


 
Posted : 16/03/2010 3:44 pm
 Earl
Posts: 1902
Free Member
Topic starter
 

Right mouse click only gives me option for Hex display.


 
Posted : 16/03/2010 3:45 pm
Posts: 3292
Full Member
 

Normally it is pretty good at working our types. Are you being slack with typing?

try adding a watch with a cast, eg: (char) my_var

or use the memory window: type &my_var in the address box and you get a memory dump with binary and ASCII from that address onwards


 
Posted : 16/03/2010 3:52 pm
 Earl
Posts: 1902
Free Member
Topic starter
 

Thanks for the replys.

Can do all the above for specific chars but Im debugging lots and lots of preexisting code so its not pratical. I remember in a prev version VS6.0 it would show me both.


 
Posted : 16/03/2010 4:00 pm