HP Forums
var1:="hello\n\tworld" - 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: var1:="hello\n\tworld" (/thread-17149.html)



var1:="hello\n\tworld" - compsystems - 06-21-2021 09:18 PM

Escape characters are not encoded in history view or [show] preview.

var1:="hello\n\tworld" [enter] "hello □ world"
PRINT(var1) [enter] ok
var1 [up] [show] "hello □ world"


RE: var1:="hello\n\tworld" - Liamtoh Resu - 06-22-2021 02:32 AM

I am trying to understand the nature of the problem.

I put together this small program to help me comprehend it.

Code:

EXPORT hellon()
BEGIN
print;
local var1;
var1 := "hello" + "\n" + "\t" + "world";
print(var1);
END;

The output looks cleaner without the "\t" substring.

Thanks.


RE: var1:="hello\n\tworld" - toml_12953 - 06-22-2021 10:26 AM

(06-22-2021 02:32 AM)Liamtoh Resu Wrote:  I am trying to understand the nature of the problem.

I put together this small program to help me comprehend it.

Code:

EXPORT hellon()
BEGIN
print;
local var1;
var1 := "hello" + "\n" + "\t" + "world";
print(var1);
END;

The output looks cleaner without the "\t" substring.

Thanks.

When you print the value of var1, it should either print the \n or it should print a linefeed. It does neither. It prints a little square.


RE: var1:="hello\n\tworld" - Liamtoh Resu - 06-23-2021 01:13 AM

I thought maybe the intent of the poster was to embed a horizontal tab inside
the "hello\nworld" string.

Ascii 9, 0x09, 0o11, 0b00001001 represent a horizontal tab.

I could not find any mention of the ppl language supporting a horizontal tab.

The best I could do was to embed four (more or less) spaces in the string
to space out the word "world".

Thanks.


RE: var1:="hello\n\tworld" - compsystems - 06-23-2021 02:33 AM

History view cmds

var1:="hello\n\tworld" [enter] "hello □ world"
PRINT(var1) [enter] ok
var1 [up] [show] "hello □ world"

PHP Code:
EXPORT hellow()
BEGIN
print;
local var1;
var1 := "hello" "\n" "\t" "world";
print(
var1); // Terminal view Ok
return(var1); // return to history view fails
END