HP Forums

Full Version: var1:="hello\n\tworld"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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"
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.
(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.
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.
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
Reference URL's