home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols000 / vol083 / ice-vdu.pli < prev    next >
Encoding:
Text File  |  1984-04-29  |  1.9 KB  |  79 lines

  1. /*******************************************************/
  2. /*                                                     */
  3. /*        VDU SUPPORT ROUTINES FOR ICE                 */
  4. /*                                                     */
  5. /*******************************************************/
  6.          
  7.         /* clear line from cursor */
  8. clear_line : procedure;
  9.     call vdu_out('^O');
  10. end clear_line;
  11.      
  12.         /* clear screen from cursor */
  13. clear_screen: procedure;
  14.     call vdu_out('^K');
  15. end clear_screen;
  16.         
  17.         /* cursor position */
  18. cursor_pos: procedure(col,row);
  19.     declare
  20.         str character(linelen) varying,
  21.         i fixed,
  22.         (col, row) fixed;
  23.     scr_row = row;
  24.     scr_col = col;
  25.     if row = 1 then
  26.         do;
  27.         call vdu_out('^N');  /* home cursor */
  28.         put skip;
  29.         call vdu_out('^N');  /* cursor home */
  30.         end;
  31.     else
  32.         do;
  33.         call vdu_out(ascii(escape)!!ascii(2)!!ascii(row+30));
  34.         put skip;
  35.         end;
  36.     if col ^= 1 then
  37.         do;
  38.         str = '';
  39.         i = 1;
  40.         do while (i<col);
  41.             str = str !! '^S';        /* cursor right */
  42.             i = i+1;
  43.         end;
  44.         call vdu_out(str);
  45.         end;
  46. end cursor_pos;
  47.         
  48.         /* home cursor */
  49. home_cursor: procedure;
  50.     call cursor_pos(1,1);
  51. end home_cursor;
  52.         
  53.         /* scroll down */
  54. scroll_down: procedure;
  55.     call vdu_out('^D');
  56. end scroll_down;
  57.         
  58.         /* scroll up */
  59. scroll_up: procedure;
  60.     call vdu_out('^B');
  61. end scroll_up;
  62.         
  63.         /* input from vdu */
  64. vdu_in: procedure(data);
  65.     declare 
  66.         data character(linelen) varying;
  67.     get edit(data) (a);
  68. end vdu_in;
  69.         
  70.         /* output to vdu */
  71. vdu_out: procedure(data);
  72.     declare
  73.         data character(linelen) varying;
  74.     put edit(data) (a);
  75. end vdu_out;
  76.         
  77. /*****************************************************/
  78.         
  79.