Jump to content

Rexx Programming/How to Rexx/literal character

From Wikibooks, open books for an open world

Special characters cannot be directly included in a literal string

[edit | edit source]

Special characters, such as controlcharacters or metacharacters cannot be included directly in a string value because these characters have a special meaning to the rexx interpreter, and including them directly will cause misinterpretation of the script. These characters can be inserted as literal characters by using hexstring notation:

Literal character representation digraphs are not supported

[edit | edit source]

The rexx language does not support the use of character representation digraphs using a backslash:

say "first line\nsecond line" # This will not interpolate to include a newline

Hexstring notation

[edit | edit source]

Hexstring notation allows ascii code sequences to be used to represent literal characters within a string:

lf = '0A'x cr = '0D'x greeting = '48656C6C6F'x /* Hello */