Try OpenEdge Now
skip to main content
Managing ABL Applications
ABL and R-code Deployment and Management : Maintaining User Environments : Maintaining the UNIX user environment : Specifying the cursor motion capability
 
Specifying the cursor motion capability
The absolute cursor-motion (cm) capability allows OpenEdge to move to any row and column on the display. The capability takes a string that is composed of two parts:
*Control characters
*Two conversion specifications
The conversion specifications allow OpenEdge to convert an integer row value and an integer column value into the arguments the terminal expects.
The cm string syntax is exactly the same as that used in the standard UNIX termcap file, in which the conversion specifications follow the pattern of the UNIX printf( ) command. The following table lists the supported conversion specifications, each of which begins with a percent sign (%).
Table 16. Syntax for specifying cursor motion string value (value)
Mnemonic
Description
%d
Send the integer to the terminal in ASCII format.
%2
Pads the value with a leading blank if it is only one digit.
%3
Pads the value with up to two leading blanks.
%.
Treats the value as an ASCII character value.
%+x
Sets value += x, then does a %
%>xy
If value > x, then value +=y; no output
%r
Reverses the order of row and column; no output
%i
Allows row and column values based on a zero origin to be incremented by one to make them appropriate for terminals whose origin is at (1,1)
%%
Gives a single %
%n
Exclusive OR row and column with 0140
%B
BCD (16*(value/10)) + (value%10); no output
%D
Reverses coding (value - 2*(value%16)); no output
%x
Gives a two-byte, zero-padded, hex value as in the "%0.2x" format for the UNIX printf() function
%M
Not similar to any UNIX printf( ) format, and given the row (row) and column (col), %Mx%Mx translates to:p1 = row / x + x p2 = row mod x + x p3 = col / x + x p4 = col mod x + 2xWhere p1 through p4 are sent to the terminal as characters
The following example is the cursor motion field for the wyse 370 terminal:
:cm=\E[%i%d;%dH:\
Where the following symbols indicate the specified action:
*\E[ — The standard ANSI console lead-in sequence (Escape, followed by a left square bracket). OpenEdge transmits this literally.
*%i — Instructs OpenEdge to add one to the row and column values to compensate for a terminal whose origin is 1,1.
*%d — Instructs OpenEdge to send the row and column values to the terminal in ASCII format.
*; — Separates the row value from the column value.
*H — A terminating character.
To create a cm string for a new terminal type, find the description of this capability in your terminal's documentation to determine the control characters and the arguments it expects to move the cursor to a random spot on the display. The documentation specifies an algorithm for converting a row/column integer pair to the arguments it needs. The manual also specifies the order in which the row and column values are expected (typically row first), and the character to use to separate the two values. For example, to move to column 65, row 66, a terminal might expect the characters A and B, which have ASCII values of 65 and 66, respectively.