REXX Tips & Tricks, Version 2.80


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


Using the lower right corner of the display



To print a character to the lower right corner of the screen without 
scrolling you must turn off the word wrap function of the ANSI driver (see 
also ANSI ESC Sequences): 

 
/* code to show how to use the lower right corner of the display      */

                    /* ESC code for ANSI sequences                    */
  ansi.__ESC = "1B"x

                    /* ANSI sequences to position the cursor in the   */
                    /* upper right corner                             */
  ansi.__Pos0 = ansi.__ESC || "[1;1H"

                    /* ANSI code to turn word wrap off                */
  ansi.__WordWrapOff = ansi.__ESC || "[7l"

                    /* ANSI code to turn word wrap on                 */
  ansi.__WordWrapOn  = ansi.__ESC || "[7h"

                    /* empty line for the menu frame                  */
  Menu.__emptyLine   = "|" || copies( " ", 78 ) || "|"

                    /* separator lines for the menu frame             */
  Menu.__FrameLine1  = copies( "-", 78 )
  Menu.__FrameLine2  = copies( "-", 76 )

                    /* menu frame                                     */
  Menu.__MenuMask = ,
     ansi.__Pos0                          || ,  /* position cursor    */
     ansi.__WordWrapOn                    || ,  /* turn word wrap on! */
     "+"  || Menu.__FrameLine1 || "+"     || ,  /* menu frame         */
     Menu.__emptyLine                     || ,
     Menu.__emptyLine                     || ,
     "| " || Menu.__FrameLine2 || " |"    || ,
     Menu.__emptyLine                     || ,
     "+"  || Menu.__FrameLine1 || "+"     || ,
     copies( Menu.__emptyLine, 14 )       || ,
     "+"  || Menu.__FrameLine1 || "+"     || ,
     Menu.__emptyLine                     || ,
     "| " || Menu.__FrameLine2 || " |"    || ,
     Menu.__emptyLine                     || ,
     ansi.__WordWrapOff                   || ,  /* turn word wrap off */
     "+"  || Menu.__FrameLine1 || "+"     || ,  /* last menu line     */
     ansi.__Pos0                          || ,  /* position cursor    */
     ansi.__WordWrapOn                          /* turn word wrap on  */

                    /* clear the screen                               */
  'cls'
                    /* show the menu frame                            */
  call CharOut , Menu.__MenuMask

                    /* position the cursor in the middle of the       */
                    /* screen                                         */
  call CharOut , ansi.__ESC || "[12;30H"

                    /* wait for a key from the user                   */
  "@pause"




Inf-HTML End Run - Successful