Action syntax

Description
Action syntax is used to specify an action to invoke, along with its parameters. This syntax is used in x3270 keymaps, c3270 keymaps, wc3270 keymaps, macros, scripts and at the x3270 prompt.

There are two forms of action syntax, formal and informal.

Formal syntax
The basic form of formal syntax is:


 * action-name([parameter[,parameter...]])

Note that the parentheses and commas between the parameters are required.

If nothing is specified between a parenthesis and a comma, or between two commas, it is interpreted as a zero-length parameter.

The basic advantage of formal syntax is that is allows multiple actions to be specified on a single line.

Informal syntax
The basic form of informal syntax is:


 * action-name [parameter...]

Note: Informal syntax cannot be used in x3270 keymaps.

Quoting
Double-quote characters (") are used to in both forms to surround a parameter that contains a space. In formal syntax, double quotes must also surround parameters that include commas or parentheses.

To include a double-quote in a parameter, put a backslash (\) before it. To end a parameter with a backslash, double the backslash. Backslashes have no other special significance.

Examples
Invoke the String action with the parameter. String(hello) String hello Invoke the Wait action with the parameters  and. Wait(1,Seconds) Wait 1 Seconds Invoke the String action with the parameter  ("hello" followed by a space). String("hello ") String "hello " Invoke the String action with the parameter. Note that the parameter passed to the action ends with two the separate characters "\" and "n", not a single newline character. It is up to the action to interpret this as a newline. String("hello\n") String "hello\n" Invoke the String action with the parameter. String("my \"real\" cat") string "my \"real\" cat" Invoke the String action with the parameter. Note that the single backslash quotes the first double-quote character, and the double backslash at the end quotes the trailing double-quote character. String("say \"hi\\") string "say \"hi\\" Invoke the String action with the parameter. Note that the backslashes have no special meaning and are passed to the action unchanged. String("fun\q run\\j ball") string("fun\q run\\j ball") Invoke the String action with two parameters: an empty string and. String(,xxx) string "" xxx Invoke the String action and then the Enter action. String(xxx) Enter

Disclaimer
This quoting convention for parameters is painful and logically incomplete. For example, it is impossible to specify a parameter that contains a space and ends with a backslash. This was not invented by the authors of the x3270 family -- it was inherited from Xt translation table syntax and then maintained for backwards compatibility.