Progress
Client Deployment
Guide


Specifying the Cursor Motion Capability

The absolute cursor-motion (cm) capability allows Progress to move to any row and column on the display. The capability takes a string that is composed of two parts:

The conversion specifications allow Progress 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. Table 5–11 lists the supported conversion specifications, each of which begins with a percent sign (%).

Table 5–11: Syntax for Specifying Cursor Motion String Value 
Mnemonic
Description
%d
Send the integer to the terminal in ASCII format.
%2
Pad the value with a leading blank if it is only one digit.
%3
Pad the value with up to two leading blanks.
%.
Treat the value as an ASCII character value.
%+x
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
Reverse 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
This conversion specification is not similar to any UNIX printf() format. %Mx%Mx translates to:
p1 = row / x + x
p2 = row mod x + x
p3 = col / x + x
p4 = col mod x + 2x
where 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:\ 

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.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095