How can I view enum's in the watch window as either their integer value or string representation?
Being able to view enums as their string representation can be extremely useful, but when using them as indexs in to arrays (extremely common) this make things a bit more difficult. The watch window does not allow me to override the display by selecting something like Hex/Dec/Unsigned etc. If I do select x16 (for example) that selection is ignored and the value is still shown as the string representation. There are work-arounds but these become quite awkward when required on a regular basis or when using arrays of enums that you want to view as either hex/int or string representation. It's also a problem when wanting to modify the variable value as it appears to be un-editable when shown as a string rep.
Thanks
-
Hi Michael, absolutely, that was the work-around mentioned above. It's definitely a work around though as when dealing with complex structures with many different variable types, containing many enums, to have to go through and individually cast each enum is very slow. Then we also have large arrays of those structures, which means that each time I try to look at the values within an element I have to cast the enums just for that element.
It really is a great feature. Maybe there could be an option along the lines of x2, x8, x10, x16, xE (for enum), which could then be used to override all enum's in an array or structure to x10/x16 and/or back to xE?
Thanks
Please sign in to leave a comment.
Comments
4 comments