Sending RCL Commands to Reflection from a Host Program

  • 7021478
  • 30-Mar-2000
  • 01-Apr-2018

Environment

Reflection 2014
Reflection X 2014
Reflection Pro 2014
Reflection for UNIX and OpenVMS 2014
Reflection for UNIX and OpenVMS 2011
Reflection for UNIX and OpenVMS version 14.x
Reflection Standard Suite 2011
Reflection for HP version 14.x
Reflection for ReGIS Graphics version 14.x

Situation

Reflection can execute Reflection Command Language (RCL) commands sent from a host program. This technical note describes the syntax used in the host program and explains how to effectively use completion codes returned by Reflection.

For an overview of how host-initiated programs work with Reflection, refer to KB 7021476.

Resolution

RCL is best used for host programs that send a single command to Reflection or that perform simple functions. To write host programs that perform complex procedures or use OLE (object linking and embedding) technology, use Reflection Basic (RB) instead. See KB 7021479 for details.

RCL commands in a host program appear on a single line within an escape sequence (HP emulation) or device control string (VT emulation).

HP Emulation

Syntax:<ESC>&o<term><RCL command><CR>

Example:<ESC>&oB SET CAPS-LOCK YES <CR>

VT Emulation

Syntax:<DCS>1234;<term> {<RCL command><ST>

Example:<DCS>1234;b {SET CAPS-LOCK YES <ST>

<ESC>, <DCS>, <ST>, and <CR> are described in Generating Special Characters below.

<term> specifies whether or not Reflection returns a completion code to the host program. See Specifying Completion Codes below for acceptable values.

Generating Special Characters

Use the values and key combinations below to properly generate the following special characters in your host programming language.

ASCII and 7-bit Values

Special characters
Decimal
Hexadecimal
Octal
7-bit
<CR>
13
0D
15
-
<ESC>
27
1B
33
-
<DCS>
144
90
220
<ESC>+P
<ST>
156
9C
234
<ESC>+\

Specifying Completion Codes

Although many choices are available, we recommend that you use one of the following values for <term>. Other options are listed in your Reflection documentation.

HP Emulation

B
Always return a completion code
F
Never return a completion code

VT Emulation

1
Always return a completion code
2
Never return a completion code

How Completion Codes are Returned

When Reflection receives a command that requires a completion code, it returns one of the following values:

S
Indicates the command was successfully executed
F
Indicates the command failed

The host program should process either reply gracefully. For an explanation of special completion codes associated with file transfers, see KB 7021480.

Additional Information

Legacy KB ID

This document was originally published as Attachmate Technical Note 1278.