HP Forums
FW 10077 - escape sequences - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: FW 10077 - escape sequences (/thread-6319.html)



FW 10077 - escape sequences - Michael K-K - 05-29-2016 04:38 PM

I'm glad to see escape sequences has made its way to the Prime.
So far I tested "\n" and "\t" - both work but "\t" produces a rectangle in terminal output (both physical Prime and emulator).


RE: FW 10077 - escape sequences - cyrille de brébisson - 05-30-2016 04:56 AM

Hello,

Complete list is:
"" -> "
\" -> "
\0
\n
\r
\t
\ooo where o are octal numbers
\xhh and \uhhhh where h are hex numbers

Cyrille


RE: FW 10077 - escape sequences - Michael K-K - 06-08-2016 02:50 PM

Hello,

thanks for the list. I recognized a problem with \t that is only printing a little rectangle but not a real tab-space.

Michael


RE: FW 10077 - escape sequences - compsystems - 06-08-2016 04:58 PM

rectangle that is very unpleasant, when I copy a program for example from notepad++ to the hpprime (simulator), could be implemented in firmware upcoming conversion to spaces


RE: FW 10077 - escape sequences - Tim Wessman - 06-08-2016 04:59 PM

Well, the reason here is that there is no character in the font for a tab, so it sticks in the "there is no character" box. In order to properly support tabs you have to do it everywhere and that is a pretty big task which is tied in with some other work on the editor and hence hasn't been done yet.


RE: FW 10077 - escape sequences - Michael K-K - 06-08-2016 05:07 PM

Thanks for explaining. Didn't know that tab is character or represented by characters in output/terminal, I thought it is a method to put the cursor to a defined position in a text line.


RE: FW 10077 - escape sequences - Tim Wessman - 06-08-2016 05:58 PM

(06-08-2016 05:07 PM)Michael K-K Wrote:  Thanks for explaining. Didn't know that tab is character or represented by characters in output/terminal, I thought it is a method to put the cursor to a defined position in a text line.

Well, that is kind of my point. Tab is a character, specifically a "control character" (https://en.wikipedia.org/wiki/Control_character).

Since the 2d expression editor is more of a general editor though, we kept the default freetype2 behavior to print out a box for any "missing" character the user puts in (otherwise you'd not be able to see anything was there and get strange behavior and no way to see where to delete something). In most cases, this works fine. Tabs however probably will get support, but it needs to be carefully done to avoid introducing other issues.

For example, I could stick in a character that was 2/4 spaces wide in the font, but that would screw up the use of that font in the connkit, as well as make it not behave as expected with alignment.

If the 2d editor/command line gets this support, it would still be missing from other places like the terminal, pop up boxes, etc. So it is a bigger task to do properly. Its on the list of things to do, and seems to fit nicely with the enhancement/changes with the text display/terminal/user text commands.