SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Features and/or Improvements => Topic started by: rgloden on July 11, 2018, 04:47:31 am

Title: Display ASCII on Hover-over-Number ... and better support for Hover-over-Hex
Post by: rgloden on July 11, 2018, 04:47:31 am
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.
Title: Re: Display ASCII on Hover-over-Number ... and better support for Hover-over-Hex
Post by: Graeme on July 11, 2018, 11:57:06 am
If you're keen you could try customizing EvaluateMouseExpression in debugpkg.e
Title: Re: Display ASCII on Hover-over-Number ... and better support for Hover-over-Hex
Post by: Dennis on July 12, 2018, 12:07:56 am
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.
Title: Re: Display ASCII on Hover-over-Number ... and better support for Hover-over-Hex
Post by: rgloden on July 12, 2018, 02:17:55 am
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.
Title: Re: Display ASCII on Hover-over-Number ... and better support for Hover-over-Hex
Post by: Graeme on July 12, 2018, 11:14:05 am
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;