String() action

From The x3270 Wiki
(Redirected from 0 escape sequence)

Enters text on the terminal, as if typed on the keyboard.

Parameters

-subst
If provided as the first parameter, variable substitution will be performed on the string. New in 4.1
string
Text to add. The text can include escape sequences.

Escape sequences

0
1
2
3
4
5
6
7
A string of octal digits specify a Unicode character. In 3270 mode, that character will be converted to EBCDIC using the host code page before being inserted at the current cursor position.
b
Invokes the Left() action.
e
Allows an 8-bit EBCDIC code to be entered at the terminal. The two characters following the \e must be hexadecimal values. This is normally used to ensure that a specific EBCDIC code is inserted, as opposed to plain text, which is translated from the local workstation's locale to EBCDIC depending on the host code page.
f
Invokes the Clear() action.
n
Invokes the Enter() action.
pa
Invokes the PA() action, with the character after \pa as a parameter.
pf
Invokes the PF() action, with the one or two numeric characters after \pf as a parameter.
r
Invokes the Newline() action.
t
Invokes the Tab() action.
T
Invokes the BackTab() action.
u
Allows the entry of a hexadecimal-encoded Unicode code point. Up to 4 hexadecimal digits will be read after the \u. In 3270 mode, that character will be converted to EBCDIC using the host code page before being added at the current cursor position.
x
An alias for \u.
\
Causes one backslash (\) character to be entered literally.

Variable substitution

New in 4.1

If the -subst option is given, environment variables will be substituted in the string. These use bash syntax, e.g., ${USER} will be substituted with the value of the USER environment variable.

Examples

Add the string foo.

String(foo)

Add the string username, tab to the next field, add the string password, and send an Enter AID.

String("username\tpassword\n")

Enter the string star.

String("st\141r")

Enter the string fuzzy\bear.

String("fuzzy\\bear")

Enter the string star.

String("st\e81r")

Send a PA2 AID to the host, then type foo and send an ENTER AID.

String("\pa2foo\n")

Send a PF1 AID to the host, then type foo and send an ENTER AID.

String("\pf1foo\n")

Send a PF21 AID to the host, then type foo.

String("\pf21foo")

Send a PF2 AID to the host, then type 23skidoo. Note the use of a leading zero to prevent the second 2 from being interpreted as part of the escape sequence.

String("\pf0223skidoo")

Enter the string star.

String("st\u0061r")

Add a string, substituting the USER environment variable: New in 4.1

String(-subst,"login ${USER}\n")