C. Writing Termcap Descriptions : Eleven Basic Commands : Cursor Motion Command : Example 3: Datamedia 3045
 
Share this page                  
Example 3: Datamedia 3045
The cursor motion string for Datamedia 3045 is ESC Y y x; where y and x are characters whose binary values are offset by 20 hex. (For this terminal, the row must be given before the column.)
To move the cursor to the position (19,11) on this terminal, you must include the sequence ESCY2*. The ESCY is the first part of the sequence. The 2 is the ASCII character with hexadecimal value 32, which is the same as 12 hex plus the 20 hex offset. Note that 12 hex corresponds to column 19 on the screen. The * is the ASCII character with a hexadecimal value of 2A, which equals 0A hex plus the 20 hex offset. Again, 0A hex corresponds to row 11 on the screen.
The cm string for this terminal is:
cm=\EY%r%+%+
The \E maps to ESC, %r is a modifier that tells the forms system that the row and column parameters are reversed, and %+ is the place marker for a character offset by a blank (which has the ASCII value of 20 hex).