Author Topic: Display ASCII on Hover-over-Number ... and better support for Hover-over-Hex  (Read 2794 times)

rgloden

  • Senior Community Member
  • Posts: 169
  • Hero Points: 5
1) It would be great if the "hover-over-number" feature which displays the number as decimal, hex, octal, binary, Unicode ... would also display as ASCII.

2) It would be great if the "hover-over-number" would also support "hover-over-hex" without the leading "0x" character ... if it is obviously a hex number.  e.g. very good chance that 6f727020 is a hex number.

Graeme

  • Senior Community Member
  • Posts: 2793
  • Hero Points: 347
If you're keen you could try customizing EvaluateMouseExpression in debugpkg.e

Dennis

  • Senior Community Member
  • Posts: 3955
  • Hero Points: 515
The unicode part does show the actual character in parens, which most of the time is also valid for ASCII.

The problem with showing hex when there is no leading 0x, for example, is that 404040 is not obviously a hex number, so that feature would only work half the time.

rgloden

  • Senior Community Member
  • Posts: 169
  • Hero Points: 5
I don't see the ASCII in parenthesis in my Unicode section of the popup.  I tried a couple of different languages ... and still no ASCII.  So I tried a few variations ... and loaded the latest hotfix ... no luck.   ???  Attached is what I see.

Graeme

  • Senior Community Member
  • Posts: 2793
  • Hero Points: 347
That's because the value is greater than 16 bits

Code: [Select]
         if (decimal_value > 32 && decimal_value < 65536) {
            hex_value = "\\u" :+ substr("0000",1,6-length(hex_value)) :+ substr(hex_value,3);
            result :+= "<br>unicode (&#"decimal_value";)\t= " :+ hex_value :+ href_push_clipboard_bgn :+ hex_value :+ href_push_clipboard_end;
         } else if (decimal_value > 32 && decimal_value < 0x7FFFFFFF) {
            hex_value = "\\U" :+ substr("00000000",1,10-length(hex_value)) :+ substr(hex_value,3);
            result :+= "<br>unicode\t= " :+ hex_value :+ href_push_clipboard_bgn :+ hex_value :+ href_push_clipboard_end;